Just a little help with file reading...
Just a little help with file reading...
I'm working on the simplest possible scripting language and all I really want to know is how I could implement comments? In my head comments start with a '#' and I just want PureBasic's File function to ignore that line... How would I go about doing something like this?
PureBasic 4.51 User
Re: Just a little help with file reading...
Line by line parsing of an open text file. Skip execution of empty lines and lines starting with a '#'
As long as you dont support multiple commands each line.
Code: Select all
While (Eof(fileID) = 0)
Command$ = Trim(ReadString(FileID))
First$ = Left(Command$, 1)
If ((First$ <> "") And (First$ <> "#"))
endif
Wend

