%RECORDLABELS


9.1

 

The %RECORDLABELS compiler directive saves the RECORD member names into a DIM variable. This DIM variable can be used when a program executes to use the RECORD text member names for the PLB application. The directive uses the following formats:

 

 

label

%RECORDLABELS

{record}[,{mode}]

Where:

label
Required. A data variable generated as a DIM.
record
Required. A previously declared RECORD variable.
mode
Optional. A decimal constant, a CONST value, or EQUATEd value that defines directive special behaviors.

 

Flags Affected: NONE

Note the following:

  1. The %RECORDLABELS retrieves the RECORD member text names from the compiler symbol table and stores them into a DIM variable. The RECORD member text names are separated using a '|' pipe character.

  2. The {mode} behavior values are defined as follows for the %RECORDLABELS directive as:

  3.  

    Value

    Meaning ...

    0

    The default value of zero causes RECORD member names to be stored using the format of 'REC.MEMBER'.

    1

    The {mode} value of one causes the RECORD member names to be stored without including the base RECORD label name.

     

  4. The RECORD member names are rendered into the DIM variable using the same case sensitivity used by the PLB compiler.

 

Example:

 

Rec

RECORD

 

M1

DIM

1

M2

FORM

1

M3

INTEGER

1

 

RECORDEND

 

 

...

 

.

 

 

RecLab

%RECORDLABELS

Rec

.

 

 

. The 'RecLab' DIM should be the same as the 'Lab' INIT.

.

 

 

Lab

INIT

"REC.M1|REC.M2|REC.M3|"

.

 

 

 

IF

( RecLab == Lab )

 

DISPLAY

"'RecLab' equals 'Lab'" //This is expected!

 

ELSE

 

 

DISPLAY

"Error: 'RecLab' NOT EQUAL 'Lab'!"

 

ENDIF

 

.

 

 

 

...

 

.

 

 

RecLab1

%RECORDLABELS

Rec, 1 //DO NOT include Base Record

.

 

 

. The 'RecLab1' DIM should be the same as the 'Lab1' INIT.

.

 

 

Lab

INIT

"M1|M2|M3|"

.

 

 

 

IF

( RecLab1 == Lab1 )

 

DISPLAY

"'RecLab1' equals 'Lab1'" //This is expected!

 

ELSE

 

 

DISPLAY

"Error: 'RecLab1' NOT EQUAL 'Lab1'!"

 

ENDIF

 

 

 

See Also: Compiler Directives

 



PL/B Language Reference PROFILE REDEFINE