If next program is run:
TYPE SortType
SortCode AS STRING*1
SortName AS STRING*20
END TYPE
DIM Sort(10) AS SortType
NbrOfSorts=0
I=0
OPEN "ADDRESS.SRT" FOR INPUT AS #1
DO WHILE NOT EOF(1)
I=I+1
INPUT #1,Sort(I).SortCode,Sort(I).SortName
LOOP
NbrOfSorts=I
CLOSE #1
CLS
PRINT "Number of sorts is: ";NbrOfSorts
END
While next ADDRESS.SRT-file, containing two lines is read:
"M","Member"
"P","Player"
The program will respond three (in stead of two) records have been found.
This works fine in QuickBasic.