a question about binary file In/Output - all examples are displaying just the use of strings or even how to read in a whole file.
I want to read and write different mixed variable types and not just bytes or strings and I'm not sure how to do this:
Example that I use is some vb6-alike pseudocode and not actual thinBasic. the empty parameter-space in put/get- command signals just to write or read the next available value
local i as Long
local myByte(10) as Byte
local myLong(10) as Long
local myDouble(10) as Double
local myString(10) as String
fNum = GetFreeFileHandle
Open "C:\myFile.dat" for binary as fNum
__for i = 1 to 10
____put fnum,,myLong(i)
____put fnum,,myDouble(i)
__next i
__for i = 1 to 10
____put fnum,,myByte(i)
____put fnum,,myString(i) + CRLF
__next i
Close fnum
and now read those values in again the same way, just using "Get fnum,,myValue" instead of "Put fNum,,myValue". How does that work in tB?
Could someone please "translate" this example?
Bookmarks