writestream.bmx 524 B

12345678910111213141516171819202122
  1. ' writestream.bmx
  2. ' opens a write stream to the file mygame.ini and
  3. ' outputs a simple text file using WriteLine
  4. out=WriteStream("mygame.ini")
  5. if not out RuntimeError "Failed to open a WriteStream to file mygame.ini"
  6. WriteLine out,"[display]"
  7. WriteLine out,"width=800"
  8. WriteLine out,"height=600"
  9. WriteLine out,"depth=32"
  10. WriteLine out,""
  11. WriteLine out,"[highscores]"
  12. WriteLine out,"AXE=1000"
  13. WriteLine out,"HAL=950"
  14. WriteLine out,"MAK=920"
  15. CloseStream out
  16. print "File mygame.ini created, bytes="+FileSize("mygame.ini")