ENFORM User's Guide
Interface Procedures
Host Language Interface
6–18 058058 Tandem Computers Incorporated
Figure 6-7. A TAL-Host Application Program Interfacing with ENFORM (Page 2 of 2)
STRUCT .order^process^rec (order^process^def); !structure allocated here
?NOLIST
?SOURCE $system.system.extdecs (ENFORMSTART, ENFORMRECEIVE,
? ENFORMFINISH, STOP);
?LIST
PROC get^params (param^message);
INT .param^message;
BEGIN
 !This procedure obtains the Command Interpreter PARAM
 !message of the form provided by the Command
 !Interpreter. It will verify that exactly two parameters
 !have been supplied and those two parameters supply values for
 !passed-custname and passed-orderdate.
 !It also adds the REQUESTORS parameter required by the
 !query processor.
END; !end of procedure get^params
 PROC main^proc MAIN;
 BEGIN
 CALL get^params (param^list); !get parameters
 !start the ENFORM query
 CALL ENFORMSTART (cntl^block !control block
 ,query^filename !compiled query
 ,$len (order^process^rec),!buffer length
 ,error !error number
 , !restart flag
 ,param^list); !parameter list
 DO BEGIN !process all odetail records belonging to the order
 count := ENFORMRECEIVE (cntl^block !control block
 ,order^process^rec); !buffer
 IF error > 0 THEN !report error to user
 CALL STOP;
 IF count THEN !if a record was received
 BEGIN
 rec^processed := true; !received some information
 !process the information here
 END; !finished with this record
END UNTIL count = 0; !until no more odetail
 !records
 CALL ENFORMFINISH (cntl^block); !control block
 END; !end of main procedure










