Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Writing resolutions to a file?

Author
Message
Dark Neo
21
Years of Service
User Offline
Joined: 2nd Jan 2003
Location: United Kingdom
Posted: 2nd Jan 2003 13:26
How would I write the display mode checklist to a file? So far all I've got is:

if file exist("res.tmp") = 1
delete file "res.tmp"
endif
open to write 1, "res.tmp"

perform checklist for display modes
write file 1, checklist quantity()

for t=1 to checklist quantity()
write byte 1, t
write long 1, checklist value a(t)
write long 1, checklist value b(t)
write long 1, checklist value c(t)
next t

close file 1
---------------------
This doesn't work! All I get is gibberish! Should I use WRITE STRING? But how would I change the value into a string?
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 2nd Jan 2003 14:50
This works, however, there's a space and a weird character before the first entry:



The resolutions are actually given as strings.

Whatever I did I didn't do it!
Dark Neo
21
Years of Service
User Offline
Joined: 2nd Jan 2003
Location: United Kingdom
Posted: 2nd Jan 2003 15:10
That's fine, they can be taken out when it's read back in. Thanks a lot.

Dark Neo
21
Years of Service
User Offline
Joined: 2nd Jan 2003
Location: United Kingdom
Posted: 2nd Jan 2003 15:19

That fixes the bit at the start.

Login to post a reply

Server time is: 2024-04-19 05:56:40
Your offset time is: 2024-04-19 05:56:40