Error while reading file

DOS specific questions.
Post Reply
BasicJan
Posts: 46
Joined: Aug 30, 2005 20:09
Location: Netherlands

Error while reading file

Post by BasicJan »

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.
mjs
Site Admin
Posts: 842
Joined: Jun 16, 2005 19:50
Location: Germany

Post by mjs »

Hmm ... I'll take a look at this one ...

EDIT: Fixed, changes are in CVS

Regards,
Mark
Post Reply