Separating Substrings in Streams

BlitzMax Forums/BlitzMax Beginners Area/Separating Substrings in Streams

The readstring function requires that you know the length of the string prior to reading it.
If you are reading from a stream you need to:
make a note of the current stream location (StartLoc)
read each character in the stream until you encounter your delimiter.
make a note of the current stream location (EndLoc)
use SeekPos to reset the stream back to StartLoc
use readstring to read in a string of length (EndLoc - StartLoc)