Ratio: 0 / 5

Inicio desactivadoInicio desactivadoInicio desactivadoInicio desactivadoInicio desactivado
 

Eval()

 

Evaluate a code block

 

Syntax

 

Eval( <bBlock> [, <xVal> [,...] ] ) --> xExpression

 

Argument(s)

 

<bBlock> Code block expression to be evaluated

 

<xVal> Argument to be passed to the code block expression

 

<xVal...> Argument list to be passed to the code block expression

 

Returns

 

<xExpression> The result of the evaluated code block

 

Description

 

This function evaluates the code bloc expressed as <bBlock> and returns its evaluated value. If their are multiple expressions within the code block, the last expression will be value of this function.

 

If the code block requires parameters to be passed to it, they are specified in the parameter list <xVal> and following. Each parameter is separated by a comma within the expression list.

 

Example(s)

 

PROCEDURE Main()
   LOCAL bBlock := {|| NIL }
   ? Eval( 1 )
   ? Eval( @bBlock )
   ? Eval( {| p1 | p1 }, "A", "B" )
   ? Eval( {| p1, p2 | p1 + p2 }, "A", "B" )
   ? Eval( {| p1, p2, p3 | p1 }, "A", "B" )
   RETURN

 

Status

 

Ready

 

Compliance

 

This is CA-Cl*pper v5.2 compliant

 

Platform(s)

 

This is available on all platforms

 

File(s)

 

Library is core

 

See also

AEval(), dbEval()