When EDT is called via the function IEDTCMD
or IEDTEXE
(see section “IEDTCMD -Execute EDT statements”), the calling program is able to declare a user-defined statement with an empty user statement symbol as the statement filter:
@USE COMMAND = ' ' ,ENTRY=entry,MODLIB=modlib
or in compatible format
@USE COMMAND=' ' (name [,modlib])
Every statement which has been entered
in F mode in the statement line
in L mode or
in EDT procedures
is then sent to this routine.
The routine is not sent
statement codes entered in F mode
statements entered via the program interfaces
IEDTCMD
orIEDTEXE
.
The routine is also sent statements with an unknown statement name or which contain syntax errors.
If multiple statements are entered (separated by semicolons) then the individual statements are passed to the routine one after the other.
The statement symbol itself is only passed if the statement is a user statement. Leading blanks in front of the statement symbol are not passed.
EDT passes the key used to send the statement in the EGLCDS
field (EDTGLCB
).
If it is not possible to convert a statement into the character set which was defined for the statement filter in the initialization routine (see section “Calling the initialization routine for auser-defined statement”) then the statement is rejected with an error message. Consequently, statement filters should work with a Unicode character set as far as possible (UTFE
is recommended).
The initialization routines for statement filters can also specify whether the filters expect to receive statements in uppercase or uppercase/lowercase notation. In the former case, the initialization routine must set the EGLCOMP
flag (EDTGLCB
) in EGLINDB
(see also section “Calling the initialization routine for a user-defined statement”).
A statement filter can use the functions of the IEDTGLE
interface. The same restrictions as for statement routines apply.
The statement passed by EDT cannot be modified in an application filter (i.e. all the changes are ignored). However, on return to EDT, the statement routine can pass the following values in the return code EGLSR1
:.
EGLMRET | EGLSR1 | Meaning |
|
| The statement should be executed. |
EUPRETOK | EUPOK12 | EDT should terminate the current statement dialog. Control is returned to the main program in the same way as if @HALT had been entered. |
EUPRETOK | EUPOK24 | The statement should not be executed. |
Note
In Unicode mode, EDT V17.0A supports the implementation of statement and user routines in C (including correct supply to the C runtime system).
However, it should be noted that this type of routine cannot run with EDT V16.6B since this version does not call statement routines with a save area which is correctly prepared for the runtime system. This shortcoming has been eliminated in EDT V17.0A compatibility mode. However, input to the runtime system in compatibility mode is only possible if the statement routine is loaded dynamically from a library. Consequently, if a statement routine written in C is to run both in Unicode and in compatibility mode it should not be statically linked to a main program.