User Tools

Site Tools


pushbind_save_runtime_expression_string_name_space_.htm
Navigation:  Language Reference > 10 - Expressions > Runtime Expression Evaluation >====== PUSHBIND (save runtime expression string name space) ====== Previous pageReturn to chapter overviewNext page

 

PUSHBIND( [ clearflag ] )

blk2blue.jpg

PUSHBIND Creates a new scope for subsequent BIND statements.
clearflag An integer constant or variable containing either zero (0) or one (1). When zero, the BIND statement's name space is cleared of all variables and procedures previously bound. When one, all variables and procedures previously bound are left in place. If omitted, the clearflag is zero.

The PUSHBIND statement creates a new scope for subsequent BIND statements. This scope terminates with the next POPBIND statement. This creates a new scope for subsequent BIND statements, allowing you to create new BIND names for variables with the same name without creating conflicts with the names from a previous scope.

Example:

SomeProc PROCEDURE

OrderNumber LONG

Item        LONG

Quantity    SHORT

CODE

BIND('OrderNumber',OrderNumber)

BIND('Item',Item)

BIND('Quantity',Quantity)

AnotherProc                      !Call another procedure

UNBIND('OrderNumber',OrderNumber)

UNBIND('Item',Item)

UNBIND('Quantity',Quantity)

AnotherProc PROCEDURE

OrderNumber  LONG

Item         LONG

Quantity     SHORT

CODE

PUSHBIND                         !Create new scope for BIND

BIND('OrderNumber',OrderNumber)  !Bind variables with same names in new scope

BIND('Item',Item)

BIND('Quantity',Quantity)

!Do some Processing

UNBIND('OrderNumber')

UNBIND('Item')

UNBIND('Quantity')

POPBIND                          !Restore previous scope for BIND

See Also:

POPBIND

EVALUATE

pushbind_save_runtime_expression_string_name_space_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)