Files, always files...

BlitzPlus Forums/BlitzPlus Programming/Files, always files...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

To write:


file=writefile("products.dat")

for p.product=each product
  writestring(file,p\name$)
  writestring(file,p\shop$)
  writeint(file,p\price)
next

closefile file



To read:


file=readfile("products.dat")

repeat

  p.product=new product
  p\name$=readstring(file)
  p\shop$=readstring(file)
  p\price=readint(file)

until eof

closefile file