Bad File Mode
Posted: Tue Mar 29, 2005 4:27 pm
why do I get bad file mode with this program ?
CLS
' Define record fields.
TYPE TestRecord
NameField AS STRING * 20
ScoreField AS SINGLE
END TYPE
' Define a variable of the user type.
DIM Rec AS TestRecord
' Open the test data file.
'
DIM FileBuffer AS TestRecord
OPEN "THi3.TXT" FOR INPUT AS #1 LEN = LEN(FileBuffer)
OPEN "THO.TXT" FOR APPEND AS #2
' Calculate number of records in the file.
Max = LOF(1) / LEN(FileBuffer)
' Read and print contents of each record.
FOR I = 1 TO Max
GET #1, I, FileBuffer
PUT #2, I, FileBuffer
NEXT I
CLOSE #1
CLOSE #2
END
CLS
' Define record fields.
TYPE TestRecord
NameField AS STRING * 20
ScoreField AS SINGLE
END TYPE
' Define a variable of the user type.
DIM Rec AS TestRecord
' Open the test data file.
'
DIM FileBuffer AS TestRecord
OPEN "THi3.TXT" FOR INPUT AS #1 LEN = LEN(FileBuffer)
OPEN "THO.TXT" FOR APPEND AS #2
' Calculate number of records in the file.
Max = LOF(1) / LEN(FileBuffer)
' Read and print contents of each record.
FOR I = 1 TO Max
GET #1, I, FileBuffer
PUT #2, I, FileBuffer
NEXT I
CLOSE #1
CLOSE #2
END