Domain: Test functions
The IS-SDF-P( ) function checks whether SDF-P is loaded in the system. If it is loaded, the result TRUE is returned. FALSE is returned as the result in the following cases:
SDF-P is not loaded.
SDF-P is loaded but the SDF-P-BASYS functionality is being simulated in the task at the moment (FUNCTIONALITY=*BASIC setting in the MODIFY-PROCEDURE-TEST-OPTIONS command, see "MODIFY-PROCEDURE-TEST-OPTIONS Modify logging and limit number of back branches ").
Format
IS-SDF-P( ) |
Result type
BOOLEAN
Input parameters
None
Result
TRUE
SDF-P is loaded in the system.
FALSE
SDF-P is not loaded in the system or the SDF-P-BASYS functionality is currently being simulated in the task.
Error messages
No error messages
Example
/A=IS-SDF-P() /SHOW-VARIABLE A A = TRUE
Application: A procedure is to be executable if only the SDF-P-BASYS functionality is available (for example, procedure parameters can be read in with SDF-P with the READ-VARIABLE command, and further checks and/or corrections can be performed on the input. the parameter can only be entered at a prompt when SDF-P is not used):
/SET-PROCEDURE-OPTIONS /DECLARE-PARAMETER A(INIT-VALUE=*PROMPT) /... /IF (IS-SDF-P()) / / “READ THE VARIABLE WITH HELP-TEXT AND CHECK THE RESULT” / IF (TASK-MODE() == 'DIALOG') /RE-READ: / READ-VARIABLE A,INPUT=*TERMINAL(PROMPT='PLEASE ENTER THE FILE NAME') / IF (NOT CHECK-DATA-TYPE (A,*FULL-FILENAME)) / WRITE-TEXT 'ERROR: &A IS NOT A FILENAME' / GOTO RE-READ / END-IF / ELSE / IF (NOT CHECK-DATA-TYPE (A,*FULL-FILENAME)) / WRITE-TEXT 'ERROR: &A IS NOT A FILENAME' / EXIT-PROCEDURE / END-IF / END-IF / “FURTHER CHECKS MAY BE CARIED OUT HERE” / .... /ELSE / “BASIC PROCESSING USING SDF-P-BASYS” / WRITE-TEXT 'PLEASE ENTER THE FILE NAME:' REMARK &A /END-IF / START-LMS //OPEN &A,MODE=*READ //..