Noob Q - File Reads/Writes
BlitzMax Forums/BlitzMax Beginners Area/Noob Q - File Reads/Writes
| ||
| 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! |
| ||
| 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! |
| ||
| what help file? Seriously, I've hardly ever used it. doh!!! Thanks. :) |
| ||
| There is a windows chm help file at http://www.2dgamecreators.com/files/ It's much better then the html files delivered with BMax. |
| ||
| 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
|
| ||
| 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. |
| ||
| ahh... thanks again. Much easier than I thought. Thanks for pointing out the obvious. ;) |
| ||
| Look up SaveText(string, file)... LoadText(file), quick and simple :) |