This call passes a statement or sequence of statements to EDT for execution.
It differs from the IEDTCMD function as follows:
EDT must already be loaded and initialized.
It is not possible to conduct a screen dialog (@DIALOG and @EDIT are not permitted).
EDT cannot be terminated or unloaded (@HALT, @RETURN and @MODE are not permitted).
It is not possible to start any EDT procedures (@INPUT and @DO are not permitted).
The following statements are permitted at the IEDTEXE interface.
Unlike in EDT V16.6, the flag EGLSTXIT in EDTGLCB is evaluated on every call via the IEDTEXE interface. On return to the calling program, the EDT interrupt routines are exited (if they have been requested). If the calling program is a statement or user routine then the status of interrupt handling is restored to its state before the call to the external routine when control returns to EDT.
If a syntax or runtime error occurs then execution is immediately interrupted with a corresponding return code and an error message. In the case of a syntax error, the EGLCMDS field (EDTGLCB) is used as an error pointer. This points to the start of the invalid statement within
the statement sequence. For reasons of compatibility, the first character after the record length field is numbered '1' (using this numbering convention, the first character in the passed statement sequence has the number '3'). Counting is always performed in characters not in bytes. The return code EUPSYERR or EUPRTERR is passed.
Unlike in the case of the IEDTCMD interface, the IEDTEXE interface may also be used in a routine which executes a user-defined statement or in a user routine (see the section on user-defined statements - @USE and user routines - @RUN) for statements sent to the calling EDT instance.
If the IEDTEXE function is called from the statement routine in a user-defined statement then no further user-defined statements may be entered.
Control structures
The following data areas must be defined before calling the IEDTEXE function in the user routine:
the control block (
EDTGLCB)the statement or statement sequence (
COMMAND)
For a description of the control block EDTGLCB, see section “EDTGLCB - Global EDT control block”. For a description of the COMMAND buffer, see section “Sequence of statements in a buffer (COMMAND)”.
The control block EDTGLCB which is passed by EDT should be used in the statement routine in a user-defined statement.
Call
The following specifications are required (see overview):
Entry of values in the control block fields in
EDTGLCBEntry of the statement sequence in the
COMMANDdata field.Call of the
IEDTEXEentry point address with the parameter list
Overview
(For the control blocks, see section “Generation and structure of the control blocks”).
Entry point address |
Parameter list |
Call parameter | Return parameter | ||
| EGLUNITEGLVERSEGLINDBEGLCCSN |
| EGLRETCEGLRMSGEGLCMDSEGLFILEEGLUSR1EGLUSR2EGLUSR3 |
COMMAND | |||
Return codes
EGLMRET | EGLRS1 |
|
|
The fields EGLMRET and EGLRS1 are fields in the control block EDTGLCB.
For the meaning of the return codes, see section “EDTGLCB - Global EDT control block”.
Call in the C program
Required include files:
#include <stdio.h>
#include <iedtgle.h>
The function IEDTEXE is also called in the C program with the address of EDTGLCB and the command for execution:
IEDTEXE(&glcb,&command);
