Enscribe Programmer's Guide
Alternate-
Key Field
RG
HARTLEY
RICHARDS
SMITH
CHICAGO, IL
MINNEAPOLIS, MN
DAYTON, OH
NO
NO
NO
0433.29
0000.00
0010.00
0500.00
0500.00
0500.00
1
2
3
4 EOF
Example 7: Insertion of a Record Into a Key-Sequenced File
This sample TAL code shows how to insert a new record into a key-sequenced primary data file:
! blank the customer record
cust^rec ':=' " " & cust^rec FOR $LEN(cust^rec) -1 BYTES;
! move the new data into cust^rec
cust^rec.cust^name ':=' "HEATHCLIFF";
cust^rec.cust^address ':=' "PORTLAND, OR.";
cust^rec.cust^region ':=' "WE";
cust^rec.cust^curbal := 0.00F;
cust^rec.cust^limit := 500.00F;
! write the new record to disk
CALL WRITE (cust^filenum, cust^rec, $LEN(cust^rec) );
IF <> THEN ... ! error
The contents of the customer file after the insertion are:
Accessing Key-Sequenced Files 95