EVAL

Purpose:

Evaluates its input argument.

Syntax:

EVAL("expr")

"expr"

-

A string, any valid expression.

Returns:

A string, series, table, or number.

Example:

mvwin(n)
{
    eval(sprintf("moveto(W%d)", n))
}

 

Creates an SPL routine that moves to a Window given a Window number.

 

mvwin(2)

 

Moves to Window 2.

 

MVWIN builds the string "moveto(W2)" and uses EVAL to evaluate the string. This has the same effect as typing moveto(w2) directly at the command line.

Remarks:

Multiple statements separated by semicolons are treated as a single unit in DADiSP. That is, they are evaluated as a group, and all macros on the line are expanded before the statements are evaluated.

 

EVAL accepts a string as its input argument and evaluates the argument.

 

See FEVAL to evaluate a function string with explicit arguments.

 

See EXECUTE to evaluate a command string in DADiSP as an ActiveX Automation Server.

See Also:

#DEFINE

; (SEMICOLON)

DEFMACRO

EVALTOSTR

EXECUTE

FEVAL

IF

MACROS

MATLAB

ONPLOT

WHILE