06-05-2006, 06:17 AM
I'm attempting to make a program that will let me enter sets of spanish and english words. In it, I have been trying to make it so you can enter the sets outside of the program and have them stored in the file Dict.dat.
The problem comes after I enter the information and it is supposedly stored in the file. In the section of code labeled "Problem Section." No matter what I change I always seem to get the message: "Input past end of file" and it highlights the line "INPUT #1, WordN$(i% + 1000)" and if I take this line out, it simply moves to the next line up.
here is the program up to the problem section;
thanks for any help!
The problem comes after I enter the information and it is supposedly stored in the file. In the section of code labeled "Problem Section." No matter what I change I always seem to get the message: "Input past end of file" and it highlights the line "INPUT #1, WordN$(i% + 1000)" and if I take this line out, it simply moves to the next line up.
here is the program up to the problem section;
Code:
LET number% = 1
DIM WordN$(1 to 2000)
IF number% < 2 THEN LET number% = 2
origin: CLS
CLOSE #1
OPEN "Dict.dat" FOR OUTPUT AS #1
DO UNTIL WordN$(number% - 1) = "exit"
INPUT "English: ", WordN$(number%)
INPUT "Spanish: ", WordN$(number% + 1000)
WRITE #1, WordN$(number%), WordN$(number% + 1000)
PRINT ""
number% = number% + 1
LOOP
WRITE #1, number%
CLOSE #1
'problem section
LET i% = 1
OPEN "Dict.dat" FOR INPUT AS #1
FOR i% = i% TO number%
INPUT #1, WordN$(i%)
INPUT #1, WordN$(i% + 1000)
NEXT i%
INPUT #1, number%
CLOSE #1
thanks for any help!