PROIV uses the LINK or LINK-CRT statement to invoke a procedural language routine.  Both statements transfer control from a PROIV logic module to a procedural language routine.  LINK-CRT is provided for support for external subroutines that perform input or output at the user's terminal since it provides for screen clearing and refreshing. When the subroutine has finished executing, processing control automatically returns to the PROIV logic statement immediately following the LINK statement.

Syntax

LINK (sub-name)    or    LINK-CRT (sub-name)
or
LINK
(sub-name{,arg}...)    or    LINK-CRT(sub-name{,arg}...)

Syntax Elements

sub-name is the name defined in the subroutine name table in extsub.c which is then used to determine which subroutine to call.

arg is optional.  Arguments are passed to and from the called subroutine by reference.  All arguments (representing PROIV strings and PROIV numerics) are passed as null terminated strings to the called subroutine.  Strings are padded with trailing spaces to the maximum length of the variable being passed.  Numerics are padded with leading zeros to the maximum variable width.  Arguments returned to PROIV should be similarly structured.

Remarks

LINK-CRT performs the following actions:

If you are only providing the cstubs.c module (using the extsub routine provided), the procedure allows for up to ten external subroutines. The names provided to call the subroutine in the LINK or LINK-CRT statement are:

sub0
sub1
sub2
 .
sub9

The names of the subroutines to be called (the names of the subroutines provided in cstubs.c) should be:

sub0( )
sub1( )
sub2( )
 .
sub9( )

You must provide the cstubs.c module to enable procedural language interfaces.  You only need to provide the extsub.c module if you want to do any of the following:

Comment on this topic

Topic ID: 720030