|
Post by hsfrey on Apr 27, 2008 15:53:42 GMT -5
I wrote this little test program
filename$ = "C:\Computers\Java\Applets\Rulelet\UsingXML\assign.xml"
OPEN filename$ for INPUT as #rulefile
i=1 WHILE EOF(#rulefile) = 0 INPUT #rulefile, line$ print line$ i=i+1 WEND
I get a syntax error for the 'INPUT' statement, though it looks to me to be syntactically identical to the sample given. Note that this is a SYNTAX error, so I assume the problem is not with the input file. Also, the error message, which basically says RTFM, is not too helpful, especially since the link is misdirected. Is there an INDEX to the various helpfiles, which would help us find relevant documentation more easily ?
|
|
|
Post by Alyce on Apr 27, 2008 16:04:20 GMT -5
The syntax error happens because RB must consider "line$" to be a reserved word. Use a different variable name and your code should work. The problem is the name of the variable, not the format of your input statement.
Here's some test code that works for me. It writes some data to a file, closes it, opens for input and reads the data with the input statement.
open DefaultDir$ + "\public\filetest1.txt" for output as #f print #f, "Test two, line one." print #f, "Test two, line two." close #f
print:print "Binary Test File 1 - Input" open DefaultDir$ + "\public\filetest1.txt" for binary as #f while not(eof(#f)) input #f, a$ print a$ wend close #f
The beta version of the updated release contains an improved helpfile.
|
|
|
Post by hsfrey on Apr 27, 2008 19:33:06 GMT -5
Alyce:
Voila! Thanks! ;D
Harvey
|
|