Overview | Statement List | Example
UFARGS/parameter list,[,IFERR,label:]
User Function has the capability to call a GRIP program via the User Function routine UF_call_grip. The UFARGS statement allows User Function and GRIP to pass arguments and results between the two languages. The first call to UFARGS results in the initialization of the GRIP variables to the values known to the User Function program. The value of the GRIP variables are assigned back into the User Function variables at the termination of the GRIP program. Any additional calls to UFARGS results in a run-time error to avoid confusion of which arguments get written back to User Function.
The following limitations exist:
This functionality is provided in INTERNAL and EXTERNAL User Function. However, the following commands are not supported in External mode when calling GRIP:
ALL OF GRIP
NC
PLNOTE
EDTXHT
CHAIN
BLANK
UNBLNK
RVBLNK
Calls can not be nested. For example, a sequence where an internal User Function program calls GRIP which XSPAWN's an internal User Function program which calls GRIP, and any similar derivative is disallowed.
UFARGS is limited to 103 arguments, the same as any other GRIP statement.
The above implementation does not provide for the system to know the length of character strings that are declared in the callers of UF_call_grip. The result is that if a GRIP string variable is larger than its corresponding User Function variable, then the system overwrites data in the caller of UF_call_grip. This can be easily avoided by having the User Function string variables declared to be one character larger than the corresponding GRIP string variables. This accounts for the "\0" terminator. The maximum length of a GRIP string variable is 132 characters.
The status returned from UF_call_grip does not indicate the many things that could go wrong while the GRIP program is executing. However, most error conditions can be returned to the Internal User Function Application through the shared argument list.
Parameter |
Description |
parameter list |
The parameter list is composed of the following elements in any order:
|
IFERR,label: |
Specifies a label to which program execution jumps if an error occurs. The IFERR can be invoked for reasons such as an invalid argument list or program not executed from User Function. |