PDECLARED Example


Example:

 

TEST

DIM

100

.

 

 

USE_RTN

ROUTINE

TEST

.

 

 

 

TYPE

TEST

 

GOTO

EXIT IF EOS

.

 

 

 

%IF

PDECLARED(EXIT) == 2

*

....

 

 This is expected at this point during compilation!!!

.

 

 

 

 DISPLAY

"'EXIT' label is Unresolved forward reference!"

 

%ELSEIF

PDECLARED(EXIT) == 4

 

 DISPLAY

"'EXIT' label is resolved reference!"

 

%ELSE

 

 

 DISPLAY

"'EXIT' label does not exist!"

 

%ENDIF

 

.

 

 

 

RETURN

 

.

 

 

EXIT

 

 

 

%IF

PDECLARED(EXIT) == 2

 

 DISPLAY

"'EXIT' label is Unresolved forward reference!"

 

%ELSEIF

PDECLARED(EXIT) == 4

*....

 

 

. This is expected at this point during compilation!!!

.

 

 

 

 DISPLAY

"'EXIT' label is resolved reference!"

 

%ELSE

 

 

 DISPLAY

"'EXIT' label does not exist!"

 

%ENDIF

 

 

RETURN

//End of the USE_RTN!

 

 



PL/B Language Reference