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 / wrtiting an array

Author
Message
large_nostril
23
Years of Service
User Offline
Joined: 5th Feb 2003
Location: United States
Posted: 10th Feb 2003 05:37
Ok, I had the idea that it would be easy to make a save game function that would be rather simple in that it produces a file with an array. I thought it would be simple because you could use the each number of the array to represent something different (i.e. array(1)=level, array(2)=number of weapons, etc.). The only problem is that I can't figure out how to write the array into an open file. If you have any ideas of how to make an easier save game function, I'de enjoy seeing them.
If you want fresh underwear in the morning, take it off the night before.
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 10th Feb 2003 05:53
Might want to take a look at the "SAVE ARRAY" command

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Red Giant 2183
23
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 17th Mar 2003 09:56
dim somearray(30)
save array "yourfile.dat" ,somearray(30)
end

RGteam~
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 17th Mar 2003 14:13
dbc has a classic bug

dim somearray(30)
save array "yourfile.dat" ,somearray(0) :rem <- always zero no matter what the size when saving
end

Login to post a reply

Server time is: 2026-06-12 03:35:39
Your offset time is: 2026-06-12 03:35:39