Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FB 0.12 problem with file input...
#1
Forgive me if I'm making a fool of myself by asking a question already proposed elsewhere, but I've found that, in FB 0.12, the LINE INPUT statement stops the compiler, with the error: "foo.bas(06) : error 10: Expected '=', found: 'input'"

Here's the (small portion of) code:
Code:
do while not eof(fh)
   line input #fh, curline
   curline = trim$(curline)

I'm puzzled.
color=blue]subxero - admin at this place.[/color]
Reply
#2
I just compiled this with 0.12b without any errors:

Code:
dim fh as integer, curline as string

fh = freefile

open "blah.txt" for input as #fh

do while not eof(fh)
   line input #fh, curline
   curline = trim$(curline)
loop

Close #fh

Perhaps you could post some more code (the definition of curline, for example).
Reply
#3
Using Allegro? LINE was removed from the keywords list (using OPTION NOKEYWORD at the top of allegro.bi), as Allegro uses ordinary names like that..
Reply
#4
Hey, thanks, I never thought of that. But, isn't that a bit pointless when Allegro's line command was ported as draw_line, and wasn't changed, even though nokeyword ..., line, ... was used?

Might want to play with that a bit. :-)
color=blue]subxero - admin at this place.[/color]
Reply
#5
Since you're speaking of line input...

Open the file in binary mode for a major speed boost in read time.

Hopefully this is a feature, and not a bug because it works great! Wink
Reply
#6
Quote:... But, isn't that a bit pointless when Allegro's line command was ported as draw_line, and wasn't changed, even though nokeyword ..., line, ... was used?

It's been changed to 'line' for the next release. Smile
Reply
#7
Then is FB 0.13 capable of processing "line input" without seeing a single token ("line")? If not, then your use of this will stop LINE INPUT from functioning, as it did for me.
color=blue]subxero - admin at this place.[/color]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)