80-Bus News

  

September–October 1983, Volume 2, Issue 5

Page 22 of 67

This example includes a number of the features previously described. The used may not necessarily be the most elegant or concise, and the example has been ‘made up’ to show the various points.

Line 10Advisable for record purposes.
Line 20Clear Screen and print a Title. (Assumes Gemini IVC Screen.)
Line 30We will have 3 Data Files. AREA1.DAT to AREA3.DAT.
Line 40Construct File Name.
Line 50Set record counter for one File.
Line 60OPEN the File on drive “A”, RANDOM, 582 byte Records.
Line 70110. Set up the Fields for drive ‘A’, (File £1). Note line 100 the use of JM$ and JU$. MBASIC does not like numbers over 255 in Field statements, so the dummy has been split. (62+240=302.)
Line 120180. Set ALL fields (Except MK$) to periods. This allows a nice display when Data entry program is run and current state of any ‘empty’ Fields is displayed.
Line 120Set MK$ to “FR”, to mark the record as FREE.
Line 190Save the initialized record to Drive “A”.
Line 200CLOSE File on Drive “A”.
Line 210270. OPEN a File on Drive “B”, set up the FIELDS, and Save the ‘empty’ Record. N.B. No need to LSET again since the FIELDS are identical.
Line 280CLOSE file again.
Line 290Keep the operator happy.
Line 300Continue until 100 Records written to the file.

Page 22 of 67