<<

Contents

Search

>>

 

SUBPROGMACRO

 

 

Function

 

 

Syntax:

SUBPROGMACRO(<Programname>,<Program-ID>,<Macroname>)

 

<Programname>

= <STRING-EXPRESSION>

<Program-ID>

= <NUM- EXPRESSION >

<Macroname>

= <STRING- EXPRESSION >

 

 

Meaning:

SUBPROGMACRO starts a macro in the subprogram <Programname>.

 

The subprogram has to be called before at least once.

 

<Programname> contains the name of the subprogram.

 

<Program-ID> contains the unique identification number of the subprogram. Within the subprogram the variable EBUS_PROGID contains the unique identification number.

 

<Macroname> contains the name of macro which has to be executed.

 

Attention: The <Macroname> has to be specified as string. The macro has to be used within <Programname>. If the macro is called only by SUBPROGNAME it will no be generated in <Programname> because it is not called in <Programname>.

 

Attention: Since the macro is called from outside of the subprogram the instruction ENDPROG has no effect, a subprogram cannot be terminated from outside.

 

SUBPROGMACRO returns the following values:

 

Value

Meaning

 1

No error

-1

The subprogram <Programname> does not exist.

-2

The macro <Macroname> does not exist within the subprogram.

-3

A program error (exception) has occurred.

 

Parameter:

Programname

Name of the subprogram

Program-ID

Unique identification number of the subprogram

Macroname

Name of macro which has to be executed

 

Sample:

H% = SUBPROGMACRO("PPRINT",PPRINT_ID%,"PPRINT.DO.PRINT")

IF H% <> 1

THEN ... Error ...

ENDIF    

 

See also:

MACRO

EBUS_PROGID