VERB


9.5A

 

The VERB instruction identifies the parameters and data types that can be used for an user defined verb. The instruction uses the following format:

 

 

[label]

VERB

{poslist}][,{nonposlist}][,{keylist}]

 

Where:

label

Optional. A Program Execution Label.

poslist

Optional. The positional parameters.

nonposlist

Optional. The non-positional parameters.

keylist

Optional. The keyword parameters.

Flags Affected: NONE

Note the following:

  1. This instruction has no impact on the generation of the a PLB program until a user creates a PLB sub-routine, LROUTINE, ROUTINE, PROCEDURE, or FUNCTION whose execution label is the same as the label specified for the VERB definition.

  2. The positional parameters {poslist} must precede all other parameter definitions in the VERB parameter list. The positional parameters define prototypes of variables the must be specified when the user-defined verb is used in a program. The positional parameters are compiled as parameters on the generated CALL instruction when the user-defined verb is executed. The positional program types can be any of the allowed prototype definitions declared using the following format:

  3.  

    #type

     

    Example:

    MyVerb VERB #varlit

    MyVerb1 VERB #varlit, #any

     

  4. A single non-positional parameter {nonposlist} can be defined in the VERB parameter list. This parameter defines the type(s) of parameters that can be included in the user-defined verb variable list. This parameter definition can be defined in the VERB parameter list anywhere after the {poslist} parameters. The non-positional program types can be any of the allowed prototype definitions declared using the following format:

    =type 

  5.  

    Example:

    MyVerb VERB =any

    MyVerb VERB #varlit, #nvarlit, =any

  6. Multiple keyword parameters can be defined in the VERB parameter list {keylist}. The keyword parameters can be declared in the VERB parameter list after the {poslist} parameters. The keyword parameters can be specified in the VERB parameter list with or without up to five (5) operands that are assigned to the keyword using an equal sign (=). The optional keyword operands must follow an equal sign and are delimited by a colon (:) character when more than one operand is declared. The keyword name must be provided using the same characters as allows for a PLB label. The keyword parameter program types can be any of the allowed prototype definitions declared using the following formats:

  7.  

    keyword

    keyword=type

    keyword=type:type

    keyword=type:type:type

    keyword=type:type:type:type

    keyword=type:type:type:type:type

     

    Example:

    MyVerb VERB ABC

    MyVerb1 VERB ABC=any

    MyVerb2 VERB ABC=any:varlit

    MyVerb5 VERB ABC=any:any:any:varlit:nvar

    MyVerbX VERB ABC=any,FILENAME=afile:cvarlit

     

    Example:

     

    MyVerb VERB #IFILE, NAME=cvarlit, EXCLUSIVE

     

  8. After VERB definition has been declared, the end-user application must provide a sub-routine, LROUTINE, ROUTINE, PROCEDURE, or FUNCTION that has the same execution label name as specified for the VERB definition.

  9. Once the VERB definition has been declared, the user-defined verb can be invoked like any normal PLB statement. The positional parameters for the VERB parameter definitions must be specified and the appropriate data types must match the prototype data type(s) that have been defined. The non-positional and keyword parameters are optional and must be specified after the positional parameters. The non-positional and keyword parameters are retrieved from the VERB parameter list using the GETPARM and LOADPARM instructions after the user-defined routine has started executing.

  10. The allowed VERB prototype types are defined as follows:

  11.  

    Prototype

    Allowed Parameter

    ARRAY

    any array variable

    AFILE

    an afile variable

    ANY

    any type of variable

    CARRAY

    1, 2, or 3 dimensional array

    CARRAY1

    a 1 dimensional character variable array

    CARRAY2

    a 2 dimensional character variable array

    CARRAY3

    a 3 dimensional character variable array

    CNVAR

    any character or numeric variable

    CNVARLIT

    any character or numeric variable

    COMFILE

    a comfile variable

    CVAR

    any character variable

    CVARLIT

    a character variable or literal

    FILE

    a file variable

    IFILE

    an ifile variable

    LIST

    a list or varlist

    LABEL

    a program label (9.5B)

    NVAR

    a numeric variable

    NVARLIT

    a numeric variable, numeric literal, or decimal constant

    NARRAY

    a numeric array variable

    NARRAY1

    a 1 dimensional numeric array variable

    NARRAY2

    a 2 dimensional numeric array variable

    NARRAY3

    a 3 dimensional numeric array variable

    PFILE

    a pfile variable

    OBJECT

    an object variable

    VAR

    any single valued variable

    VARLIT

    any single valued variable or literal

 

 

See Also: Example Code, GETPARM, LOADPARM, RESETPARM, Compiler Directives

 



PL/B Language Reference UNIXCOMMAND WARNING