Noob Q - File Reads/Writes

BlitzMax Forums/BlitzMax Beginners Area/Noob Q - File Reads/Writes

MGE(Posted 2008) [#1]
I've learned pretty much everything I need to know except how to read and write files. Integers, floats, strings, etc. Is there a tutorial or something you can point me to? Thanks!


CS_TBL(Posted 2008) [#2]
Look up the help for things like ReadInt, ReadFloat, WriteInt, WriteFloat, and WriteFile.

It's simple tho, you'll get the idea in a splitsecond!


MGE(Posted 2008) [#3]
what help file? Seriously, I've hardly ever used it. doh!!! Thanks. :)


Volker(Posted 2008) [#4]
There is a windows chm help file at http://www.2dgamecreators.com/files/
It's much better then the html files delivered with BMax.


CS_TBL(Posted 2008) [#5]
Those html files are enough to learn file I/O however.

Anyway:
SuperStrict
Local a:TStream=WriteFile("c:\b00h.txt")
WriteByte a,65
CloseFile a

Local b:TStream=ReadFile("c:\b00h.txt")
Print ReadByte(b)
CloseFile b



Volker(Posted 2008) [#6]
Those html files are enough to learn file I/O however.

The help file IS the html files in windows chm format.
Its so much easier if you can search for "file" as example and it shows you up: brl.filesystem, brl.stream, brl.endianstream etc.


MGE(Posted 2008) [#7]
ahh... thanks again. Much easier than I thought. Thanks for pointing out the obvious. ;)


Czar Flavius(Posted 2008) [#8]
Look up SaveText(string, file)... LoadText(file), quick and simple :)