RETURN


Terminates the execution of a CBS procedure.

Syntax

RETURN [<exp>]

Arguments

<exp> is an expression of any type that evaluates to the return value for CBS script procedures. If the CBS procedure terminates without executing a RETURN statement, the return value is the result of the last statement executed. If the last statement executed does not return a value then "" (empty character string) is returned.

Description

RETURN terminates a CBS script procedure returning control to either the calling CBS script procedure or back to Visual Builder. There can be more than one RETURN in a CBS procedure. A CBS procedure need not end with a RETURN but it is recommended.

When Visual Builder executes scripts it may expect a specific return value. For example, when evaluating a rule script, it expects a return value of TRUE if the record should be included or FALSE if it should be skipped.

Example

* Return TRUE if dDate2 is less than or equal to dDate1.

* Otherwise FALSE is returned.

IF dDate1 > dDate2

   Echo('Invalid date range specified.')

   Return FALSE

Endif

Return TRUE

 



CAPITAL VISUAL BUILDER