Bankstream - Readline
BlitzMax Forums/BlitzMax Beginners Area/Bankstream - Readline
| ||
Whats wrong with this code? "t" is empty after ReadLine. SuperStrict Local mbank:TBank = CreateBank() Local mbstream:TBankStream = CreateBankStream (mbank) Local t:String = "Line" mbstream.WriteLine (t) t = mbstream.ReadLine() Print t |
| ||
The position of the stream is altered after the write, so there is no data to read. Try seeking to the beginning before reading. Local mbank:TBank = CreateBank() Local mbstream:TBankStream = CreateBankStream (mbank) Local t:String = "Line" mbstream.WriteLine (t) mbstream.Seek(0) ' <------ t = mbstream.ReadLine() Print t |
| ||
Checked. Thanks! |