Enscribe Programmer's Guide
CALL READ (order^filenum, order, $LEN(order) );
IF > OR order.order^date >= limit^date THEN order^eof :=1
ELSE
BEGIN ! fill order
! read customer file
CALL KEYPOSITION (cust^filenum, order.order^name);
CALL READUPDATE (cust^filenum,cust^rec,
$LEN(cust^rec) );
! print the order header
! read order detail file for current order
compare^len := 2;
generic := 1;
CALL KEYPOSITION (orderdet^filenum,
order.order^orderno, , compare^len, generic);
orderdet^eof := 0;
WHILE NOT orderdet^eof DO
BEGIN
! read line item
CALL READ
(orderdet^filenum, orderdet,
$LEN(orderdet) );
IF > THEN orderdet^eof := 1
ELSE
BEGIN
CALL KEYPOSITION (inv^filenum,
orderdet.orderdet^partno);
CALL READUPDATE (inv^filenum, inv,
$LEN(inv) );
: ! update the inventory record
CALL WRITEUPDATE (inv^filenum, inv,
$LEN(inv) );
: ! update the order detail record
CALL WRITEUPDATE (orderdet^filenum,
orderdet, $LEN(orderdet) );
! print the line item
END;
END;
: ! update the order record
CALL WRITEUPDATE (order^filenum, order,
$LEN(order) );
: ! update the customer record
CALL WRITEUPDATE (cust^filenum, cust^rec,
$LEN(cust^rec) );
: ! print the total
END; ! of fill order
END; ! reading order file via date field
The records used for filling the first order are:
From the order file:
0020 SMITH 95/09/30 0000.00
From the customer file:
SMITH DAYTON, OH NO 0010.00 0500.00
104 Key-Sequenced Files