Statement DO Foundation

Calls a procedure.

Syntax
DO <ProcedureName> [WITH <Arguments,...>]
Parameters
<ProcedureName>
<ProcedureName> designates the name of a procedure or user-defined function which is to be executed.
<Arguments,...>
<Arguments,...> is a comma separated list containing up to 128 expressions whose values are passed to the procedure <ProcedureName>.
Description

The statement DO...WITH exists only for compatibility and should not be used. Instead, use the following syntax to call a function a procedure:

<ProcedureName>( [<Arguments,...>] ) 

The optional list of the function arguments is indicated in parentheses.

The DO statement is almost identical to the call of a user-defined function or procedure. One difference is that arguments to a user-defined function or procedure are inside parentheses. Another difference between DO and a function call is that by default DO passes variables by reference, whereas functions pass them by value. Field variables must be indicated in parentheses, unless an alias name plus alias operator is placed in front of them.

Examples
Calling a procedure with DO
// The example demonstrates the syntax which is to be used 
// instead of the DO statement. 

PROCEDURE Main 

     DO TestProc                     // Compatibility 
     DO TestProc WITH "A", 1 

     TestProc()                      // Recommended syntax 
     TestProc( "A", 1 ) 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.