Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Excerpt
hiddentrue

do(expression1, expression2,..., expressionN) Evaluates a number of Expressions in sequence and returns the value returned by the last Expression in the list.


Function: do()

Evaluates a number of Expressions in sequence and returns the value returned by the last Expression in the list.

...

do(expression1, expression2[,..., expressionN])

ArgumentTypeDescription
expressionNExpressionAny valid Expression

If Note that if a break() or continue() function is used within the do() then the do() function returns immediately and since it has not reached the last expression in the list a _NULL value will be returned.

Examples

Code Block
do(
   //evaluate an expression
   $number = 1,
   
   //and then evaluate another expression
   $word = "Word"
)

This whole do() block evaluates to the value of the last expression: "Word"

Note that $number and $word are still available after the do() statement has been concluded.


Code Block
do( 
   $difference = crm.total - billing.total, 
   
   if( $difference != 0, 
      addElement( $errors, "difference in totals") 
   ),
 
   $difference
)

The first expression in the list calculates the difference between a total from the CRM system and a corresponding total from the Billing system and then assigns this difference to the $-Variable $difference.

...