Way of checking for end of data
Way of checking for end of data
At the moment once all data has been read and reading continues, it will generate a browser error. It would be nice to be able to detect in SpiderBasic whether all data has read or not.
Re: Way of checking for end of data
What's wrong with doing this? It works with PureBasic and I've tested it on a SpiderBasic application
Code: Select all
Restore BeginDictionary
While TempString.s <> "_EndDictionary_"
Read.s TempString.s
If TempString.s <> "_EndDictionary_"
; Do something here
EndIf
Wend
TempString.s = "<>"
DataSection
BeginDictionary:
Data.s "-", "/space"
Data.s "_", "/space"
Data.s "#", "/space"
Data.s "@", "/space"
Data.s "!", "/space"
Data.s "_EndDictionary_", "_EndDictionary_"
EndDataSection
Re: Way of checking for end of data
The problem is if you for get any data terminator the program (or rather the browser) will hang...
Re: Way of checking for end of data
Weird, the above method works properly for me in PB AND SB without any issues.MrTAToad wrote:The problem is if you for get any data terminator the program (or rather the browser) will hang...
Re: Way of checking for end of data
Are you omitting the last data line ?
Re: Way of checking for end of data
No. I needed a recogniseable end of data marker so I didn't have those runaway problems:)MrTAToad wrote:Are you omitting the last data line ?
Re: Way of checking for end of data
I don't see why a marker is a problem, as you define the data yourself
Re: Way of checking for end of data
It's not - but if you try to read past the end of data, then its a problem.Fred wrote:I don't see why a marker is a problem, as you define the data yourself