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 / Help! I can't save 2 dimensional arrays!

Author
Message
The CodeSmith
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 24th Nov 2004 03:04
I am having a problem with my program. I am using the SAVE ARRAY command, but it appears that it doesn't work with anything other than one dimension. I posted my code, please look through it to tell me whats wrong! Thank you for your time.

Intel P4 3.0 GHZ, 512 Duel RAM, Geforce 5200 Fx 128 MB, 80 GB Hard Drive
"May flying hamsters of DOOM rain coconuts on your city!"
Rob B
21
Years of Service
User Offline
Joined: 13th Jan 2004
Location: Paola
Posted: 24th Nov 2004 05:13
Try dropping the array dimentions on save.
Also save it as a .dat file.

save array "MyArray.dat",QsAs$(0)
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 24th Nov 2004 20:57
Or just write to the file in for next loops..problem solved.

AKA teh great Pet Rat.
Peace sells...but who's buying??
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 25th Nov 2004 08:29
save ARRAY "C:\Programs\Test",QsAs$(0)

load ARRAY "C:\Programs\Test",QsAs$(0)

You can do it if you try
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 27th Nov 2004 00:51
Uhh, X_MEN... that's basically what biggie said... but easier to implement, to your credit

Yup, I checked, everybody's right about using 0 rather than typing in 2,5. Cool.

The CodeSmith
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 5th Dec 2004 03:07
Ok, I have been gone for a while and I got the array to save but now i am trying to make a second program that will load the array. I am having to problems.
1. I can't get the array to load
2. I ccan't make my array save to the file name of my choice eg.
PRINT "What would you like to save your array to?"
INPUT a$
SAVE ARRAY - and this is where I can't figure out how to save the file name as the input
Thanks

Intel P4 3.0 GHZ, 512 Duel RAM, Geforce 5200 Fx 128 MB, 80 GB Hard Drive
"May flying hamsters of DOOM rain coconuts on your city!"
Don Malone
22
Years of Service
User Offline
Joined: 27th Apr 2003
Location: Birmingham, Alabama
Posted: 5th Dec 2004 10:56 Edited at: 5th Dec 2004 10:57
The help states

To load an array

LOAD ARRAY filename,Array name(0)

to save

use the save array command with the same filename, the array name does not have to be exactly the same but must be large enough to hold the loaded data.

the help file for Dark Basic Classic is pretty handy and useful if you can figure out where to look for the help.

[edit] The file name should probably be in quotation marks.

Wasting CPU Cycles since the 286 was a hot machine.

Login to post a reply

Server time is: 2025-05-29 07:57:58
Your offset time is: 2025-05-29 07:57:58