DATA (begin routine local data section)

Top  Previous  Next

 

            DATA

The DATA statement begins a local data declaration section in a ROUTINE. Any ROUTINE containing a DATA section must also contain a CODE statement to terminate the data declaration section. Variables declared in a ROUTINE data section may not have the STATIC or THREAD attributes.

Example:

SomeProc PROCEDURE

CODE

!Code statements

DO Tally                !Call the routine

!More code statements

 

Tally ROUTINE            !Begin routine, end procedure

DATA

CountVar BYTE            !Declare local variable

CODE

CountVar += 1           ! increment counter

DO CountItAgain         !Call another routine

EXIT                    !and exit the routine

See Also:

CODE

ROUTINE