The sdfrd function causes SDF
to read a program statement from SYSSTMT. (The assignment for the SYSDTA system file also applies to SYSSTMT. The rules governing continuation lines, continuation characters, logging and comments in SYSSTMT are the same as those that apply to SYSCMD.)
analyze the statement read in and
transfer the result of this analysis to the program.
This presupposes that an activated syntax file contains the definition of the program and its statements. For details, see the description of the RDSTMT macro ("RDSTMT Read and analyze statement").
Since the function has a number of optional parameters, there are 5 different formats.
Format 1:
int sdfrd (char *area);
Format 2:
int sdfrdmsg (char *area, char *msg);
Format 3:
int sdfrdall (char *area, char *msg, char *allow);
Format 4:
int sdfrdpre (char *area, char *msg, char *allow, STR8 prefer);
Format 5:
int sdfrddef
(char *area, char *msg, char *allow, STR8 prefer, char *def1,
char *def2, char *def3, char *def4, char *def5);
Description of the parameters
char *area | Pointer to the buffer in which the standardized transfer area was | ||||
char *msg | Pointer to a message to be output before the statement is read. | ||||
char *allow | Pointer to the list of valid statements Format of list of valid statements: N | statement 1 | statement 2 | ..... | statement n
| ||||
STR8 prefe | Only in guided dialog: internal name of the statement expected next, | ||||
char *def1,*def2,*def3,*def4,*def5 | Pointers to up to 5 conversion descriptions with which default values of operands can be replaced by values generated dynamically by the program. A value must be specified for each of the 5 pointers. Pointers not needed must be specified as NULL pointers. All pointers after the first NULL pointer are ignored. |
Result
The function returns an integer as its result (see "Description of the C functions").
Read and convert default values
With the aid of conversion descriptions, default values of operands defined in the syntax file with ADD-VALUE ...,VALUE=<c-string>...(OVERWRITE-POSSIBLE=*YES) or ADD-OPERAND...,OVERWRITE-POSSIBLE=*YES can be replaced by values generated dynamically by the program. Only one conversion description can be specified per statement. The conversion description contains the internal statement name and the information defining which operand values can be replaced and how. A conversion description can be generated either by an sdfrd call executed beforehand or by an sdftr call in which the new values are entered. This description has the format of a standardized transfer area.