Versions Compared

Key

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

...

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

ArgumentTypeDescription
expressionNExpressionAny valid Expression

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
)

...