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.

Author
Message
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 11th Dec 2011 15:08 Edited at: 11th Dec 2011 15:17
I've been trying to get this peice of code working but it won't becuase the save array is in the wrong place snf i don't know where to put it, so can someone please find the right place. Thank you.
It's the PScore array which have the problem.
Thanks again for looking.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 11th Dec 2011 17:05 Edited at: 11th Dec 2011 17:07
My first guess is this label: Make_Fold: contains your array declaration; dim PScore(1), but the label has never been called. This must be called before Save Array is called.

It is difficult to figure out the problem because of all the Goto calls you are using; it is really bad. I cannot test it easily because you have not uploaded the media files.

Try put your code in IF or SELECT branches instead of goto labels; for example:

This:


Is easier to follow than



Why? Because it shows you what takes place and reads from top to bottom; exposing what takes place when a condition is met, what happens first and what takes place after.

The second half of your program looks tidy compared to the first though.

Goto command discussion
How to avoid Goto: By TDK Man
About loop commands

Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 11th Dec 2011 18:05
thxs for the reply but i am still confused. Can u explian the array never been called in a bit more detail
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 11th Dec 2011 18:51
I fixed it the only problem is I want it to check if the array exist so i can have it save for next time they play. How do you do that it DarkBasic classic.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Dec 2011 19:31
Quote: "How do you do that it DarkBasic classic. "

Maybe you should ask in the Dark Basic classic board? lol This is the Dark Basic Pro board.

My signature is NOT a moderator plaything! Stop changing it!
Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 11th Dec 2011 19:49
I thought most people would know becuase it the same langue but with more commands and better layou
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 11th Dec 2011 21:31
Why not stop yourself from having to check if the array exists by creating the array as your first, or one of your first commands?

If you want to check that it has some data inside of it; check its size or use a boolean variable to store its state.

I am clueless with Dark Basic Classic; I only used it once about 4 years ago.

Flamertor
14
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 12th Dec 2011 07:54
How would I do that? Im not the best at this lol. Seems to be each bit i need more help at.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Dec 2011 23:24
Pwrhaps switch to dbpro then?

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 13th Dec 2011 02:36
Place the dim statement; dim PScore(1); on the first line; then the array will exist throughout your program.

In DBPRO you can check if an index exists with: Array Index Valid(), which returns 1 if the index is greater than zero or less than the array size.

Or you can manually compare the index to see if it is lower or equal Array Count().

Login to post a reply

Server time is: 2026-07-11 12:01:59
Your offset time is: 2026-07-11 12:01:59