80-Bus News

  

September-October 1983, Volume 2, Issue 5











Page 22 of 67











22

60 OPEN "R", £1, FNAM$, 582

70 FIELD£1,2 AS MK$,3 AS NUM$,5 AS DIS$,22 AS NAMS

80 FOR A=1 TO 9

90 FIBLDS1,32 AS DM$,30*(A-1) AS JP$,5 AS CN$(A),20 AS CNA$(A),5 AS CONS$(A)

100

110 120 130 140 150 160 170 180 190 200 210 220 230 240 250

260 270 280 290 300 310 520

code

FIELD£1,62 AS JM$,240 AS JU$,31*(A-1) AS M$,14 AS TS(A),11 AS 0$(A),6 AS C$(A)

NEXT A

LSET MK$="FPR":LSET DIS$="......"2:LSET NAMS="...ceeee cece ccceceeeee”

LSET NUM$="..."

FOR A=1 TO 9

LSET CNS(A)="....."2LSET CNAS(A)=". ec cece eer eesere cece”

LSET CONS$(A)=".....":LSET TS(A)H". ec ccc cence eee”

LSET OS(A)=H"e cece coos ee "ZLSET CS(A)H" eee eee”

NEXT A

PUTL1 , RN

CLOSEE1

OPEN "R",£1,"B:"+FNAMS, 582

FIELD2£1,2 AS MK$,3 AS NUM$,5 AS DIS$,22 AS NAMS

FOR A=1 TO 9

FIRLDS1 ,32 AS IM$,30*(A-1) AS JP$,5 AS CN$(A),20 AS CNA$(A),5 AS CONS$(A) FIELDE£1,62 AS IM$,240 AS JU$,31*(A-1) AS M$,14 AS TS(A),11 AS O$(A),6 AS c$(A)

NEXT A

PUTE£1 , RN

CLOSES

PRINT "FILE ";FNAM$;" – RECORD No ";RN;" INITIALIZED. "

NEXT RN

NEXT X

SYSTEM

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 10 – Advisable for record purposes.

Line 20 --- Clear Screen and print a Title. (Assumes Gemini IVC Screen. ) Line 30 = We will have 3 Data Files. AREA1.DAT to AREA3.DAT.

Line 40 – Construct File Name.

Line 50 – Set record counter for one File.

Line 60 -- OPEN the File on drive "A", RANDOM, 582 byte Records. Line 70 – 110. 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 120 – 180. 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 120 – Set MK$ to "FR", to mark the record as FREE.

Line Line Line

Line Line Line

190 – Save the initialized record to Drive "A".

200 – CLOSE File on Drive "A".

210 – 270. 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.

280 – CLOSE file again.

290 – Keep the operator happy.

300 – Continue until 100 Records written to the file.


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 22 of 67