Eval()

EVAL()

Evaluate a code block

Syntax

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

Arguments

<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.

Examples

      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

Tests

      See examples

Compliance

Clipper

Platforms

All

Files

Library is vm

Seealso

AEVAL(), DBEVAL()

4 responses to “Eval()

  1. Pingback: Harbour All Functions – E | Viva Clipper !

  2. Pingback: Harbour hvm Functions | Viva Clipper !

  3. Pingback: Harbour Error Handling Functions | Viva Clipper !

  4. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.