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.

Newcomers DBPro Corner / 0kb files, data to save, and its not saving. please help!

Author
Message
Matt McFarland
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location: Cincinnati, OH. USA
Posted: 30th Nov 2003 06:25
I have successfully figured out how to save an array (SAVE ARRAY LOL) thanks to dboy...

um..

The array DOES have data in it, and I have debugged and verified that it is holding data.

But its not saving it to the file.. the file gets created, and stays at 0kb

I have attached my code. What am I doing wrong?

repeat : DarkBASICPro = LearnStatus() : until DarkBASICPro = FullyUnderStood
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Nov 2003 06:57
does Grid have to include the upperbound index value? because you are saying "Grid" and not "Grid()" or "grid(index upperbound val)"

I am not sure I have never used the command, but it would make programmatic sense to provide something else other than "grid"

-RUST-
Matt McFarland
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location: Cincinnati, OH. USA
Posted: 30th Nov 2003 07:06
Grid is the name of the array..
It holds 811 integers.

Would I say SAVE ARRAY grid(811)?

or would that be saving only the 811th index?

repeat : DarkBASICPro = LearnStatus() : until DarkBASICPro = FullyUnderStood
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Nov 2003 07:10 Edited at: 30th Nov 2003 07:11
whatever the highest index value that has data. If you say it holds 811 pieces of data, indexes are zero-based meaning 0 to 810 = 811

dbp help:
SAVE ARRAY
This command will save the contents of the array to the specified file. It is highly recommended that the
array used to save the data should be identical to the one used when reloading. When specifying the array
name, the array index numbers are ignored, but you must still provide them to ensure the array is
recognized.

SYNTAX
SAVE ARRAY Filename, Array Name(0)

-RUST-
Matt McFarland
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location: Cincinnati, OH. USA
Posted: 30th Nov 2003 07:11
actually..

grid() surely worked, thank you!

repeat : DarkBASICPro = LearnStatus() : until DarkBASICPro = FullyUnderStood
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Nov 2003 07:12
no problem

-RUST-
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Nov 2003 07:13
yes, non specified with () makes perfect sense.


-RUST-
Matt McFarland
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location: Cincinnati, OH. USA
Posted: 30th Nov 2003 07:18
It even loads it correctly too! I am very happy you replied! thanks for the tidbit! =D

repeat : DarkBASICPro = LearnStatus() : until DarkBASICPro = FullyUnderStood

Login to post a reply

Server time is: 2024-11-25 18:29:12
Your offset time is: 2024-11-25 18:29:12