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 Professional Discussion / saving arrays.....

Author
Message
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 1st May 2003 21:51
I`m having a problem saving an array in my code

the array is defined as :


and I try to save it as follows


but DB gives this error message :

#100008: Parameter for `SAVE ARRAY` do not match `Filename,ArrayName(0) at line 182


but I cant see anything wrong with it, I`ve also compared it to some older code that I have done in DBClassic, which works fine! :-s

any ideas ?

simon
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st May 2003 22:26
First off, your using a reserved word as a value in your dim statement.

Secondly are mapx and mapyz defined ?

Thirdly do you have patch 4 ?

Lastly, the following works (ie something is saved) :



Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 1st May 2003 23:09
Thanks,

ok, I altered `type` to `_type`, but within the array brackets, the word type wasnt recognised as a command.
mapx & z are all defined ( mapx&mapz = 128, _type=4 )
and no, I dont currently have patch 4, but your code works fine in myDB, so its not an update problem.

But if you have used the same line as I have, I dont understand the problem ?

I`ll have a play, but any more suggestions.... TIA

simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 1st May 2003 23:14
Hmm, strange, when I change (mapx,mapz,_type) for (128,128,4) it wroks..
but thats not any good really to me.......

simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 1st May 2003 23:14
but looking at your code again, that uses a,b,c not 1,1,1, so mine should work ?

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st May 2003 23:58
Can you show us a small example?
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd May 2003 00:12
Here it is with your variables :



Try that and see what happens.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 2nd May 2003 03:02
yes, that works too ?????

ok, time to admit, that theres probably something else in my code that is the problem, but why would it come yp with an erroe telling me that I have got the format wrong for the save array line?

simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 2nd May 2003 03:21
I`ve changes the save to save the `objects` array, instead of the `sector` array, that worked : but when changed back, it didnt work

I`ve renamed sector to `test_array`,(just the dim array line & the save line - nothing else ) that worked, so I renamed it back, to sector, and it woks fine!?!?!??!??!??

thats one of the strangest things I have see in DB lol
I only renamed it, and then back to the orignal name, then it works!?!? LOLOLOLO x-d

simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 2nd May 2003 03:33
ok, save works now for some unknown reason :

save array "c:\sector.map",sectors(0)

but whats wrong with load ? I get the same error, saying that I`ve not typed the line correctly ?

load array "c:\sector.map",sectors(0)
???

simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 2nd May 2003 03:34
oh, found it, have to do this :

load array "c:\sector.map",sectors

ie, remove (0) from the end ?, even though, DBP asks for it ?

LEE!!!! lol

Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 2nd May 2003 22:09
could you say make a type array...

type xxx
one as string
two as byte
three as float
endtype

dim yyy(10) as xxx

could you then save the array????

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd May 2003 00:06
No, unfortunately you can't save an array of types using 'save array'. Nothing to stop you writing the code yourself though

Login to post a reply

Server time is: 2026-07-11 12:00:38
Your offset time is: 2026-07-11 12:00:38