FDECLARED Example


Example:

 

FUNC

FUNCTION

 

TEST

DIM

100

  

ENTRY

 

A

DIM

1

.

 

 

  

TYPE

TEST

  

GOTO

EXIT IF EOS

.

 

 

  

%IF

FDECLARED(EXIT) = 2

.

This is expected at this point during compilation!!!

  

DISPLAY

"'EXIT' label is Unresolved forward reference!"

  

%ELSEIF

FDECLARED(EXIT) = 5

  

DISPLAY

"'EXIT' label is resolved reference!"

  

%ELSE

 

  

DISPLAY

"'EXIT' label does not exist!"

  

%ENDIF

 

.

 

 

 

RETURN

 

.

 

 

EXIT

 

 

 

$%IF

FDECLARED(EXIT) = 2

 

DISPLAY

"'EXIT' label is Unresolved forward reference!"

 

%ELSEIF

FDECLARED(EXIT) = 5

.

This is expected at this point during compilation!!!

 

DISPLAY

"'EXIT' label is resolved reference!"

 

%ELSE

 

 

DISPLAY

"'EXIT' label does not exist!"

 

%ENDIF

 

 

RETURN

 

.

 

 

 

FUNCTIONEND

 

 

 



PL/B Language Reference