eval

From DavinciWiki
Jump to: navigation, search


64-bit SafeYes

Description

Evaluates the contents of an object whose name is a supplied STRING

Arguments and Return Values

Arguments: The string name of a variable

Return Value: The contents of the variable

Usage

Syntax: eval(stringname)

The variable can contain any type of data, or any string.

Examples

dv> a
345x200x10 array of float, bsq format [2,760,000 bytes]

dv> b
"bob"

dv> eval("a")
345x200x10 array of float, bsq format [2,760,000 bytes]

dv> c=eval("b")
"bob"

eval can also execute functions.

dv> a
4x3x2 array of float, bsq format [96 bytes]
 0.000000000     1.000000000     2.000000000     3.000000000
4.000000000     5.000000000     6.000000000     7.000000000
8.000000000     9.000000000     10.00000000     11.00000000 

0.8414945602    0.4565652609    0.07009354979   0.2013418674
0.02954937331   0.7624585032    0.1842665672    0.6608442068
0.7146587372    0.6201407909    0.6733769178    0.01750716381

dv> eval("thm.maxpos(a)")

Location: 4,3,1
11.0000000000000

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 07-06-2009

Personal tools