writefile??
BlitzMax Forums/BlitzMax Beginners Area/writefile??
| ||
If KeyHit(KEY_F2) Then SaveMap("map/test.som") Function SaveMap:Int (file:Object) Local f:Int Local fx:Int, fy:Int, fl:Int f = WriteFile(file) For fx = 0 To 32 For fy = 0 To 32 WriteInt f, tilemap[fx,fy,0] Next Next CloseFile f End Function why doesn't this work?? |
| ||
what problem are you having? the first thing i see offhand is the variable f. it should be of type TStream:Local f:TStream my guess is that will clear things up. if it doesnt, have you put DebugLog statements in there to check how far your getting? right along with the WriteInt put a DebugLog of the same info and see whats trying to being written. |
| ||
Try to add: Createfile(file) before the writefile command. and try the above post. |
| ||
When you say doesn't work, what happens? Is the file created at all? Also, If you're going to use an integer file handle, don't forget to release it before you exit the function. |
| ||
He got it working. :) |