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 / Array Type Is Invalid?

Author
Message
CSGames94
18
Years of Service
User Offline
Joined: 27th Dec 2007
Location:
Posted: 29th Jul 2011 09:22 Edited at: 29th Jul 2011 09:23
Been working on a big project for sometime now and I can't seem to get the "Save Array" command to work. I'm trying to save the array that holds all the menu panels created in my menu editor:

I'm using this when saving:

But every time I save inside my editor, it gives me this error.
If I knew what the error meant, I would be able to solve the problem myself, but I just don't understand it.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Jul 2011 09:34
The problem is that you can't save a typed array, although I am sure that it's possible using IanM's plugins.

You would have to make your own file format, and save the type elements individually - which might be the best option considering your array size is dynamic.

Health, Ammo, and bacon and eggs!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Jul 2011 15:15
Quote: "although I am sure that it's possible using IanM's plugins"

Yup, but it also means that you also have to use my datafile commands (which replace DBPro's built-in file commands).



The OPEN DATAFILE TO WRITE command will work whether the file already exists or not.

CSGames94
18
Years of Service
User Offline
Joined: 27th Dec 2007
Location:
Posted: 29th Jul 2011 18:39
Quote: "The problem is that you can't save a typed array, although I am sure that it's possible using IanM's plugins.

You would have to make your own file format, and save the type elements individually - which might be the best option considering your array size is dynamic.
"
Yeah, I was beginning to think that's what I was going to end up having to do.

Quote: "Yup, but it also means that you also have to use my datafile commands (which replace DBPro's built-in file commands)."
I will just use your datafile plugin.

Thanks a lot guys!
CSGames94
18
Years of Service
User Offline
Joined: 27th Dec 2007
Location:
Posted: 29th Jul 2011 22:01
Now I get a "Array Not Resized Correctly Error", saving works, but when I try to load it I get this error:
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Jul 2011 23:45
Make sure that you are using the very latest version of my plug-ins - that was a bug that was fixed a few months ago IIRC.

CSGames94
18
Years of Service
User Offline
Joined: 27th Dec 2007
Location:
Posted: 30th Jul 2011 02:18 Edited at: 30th Jul 2011 02:21
I think I do have the latest (matrix1util 20110420). I got it off your sig.
Also, could I get my name changed to CSGames?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Jul 2011 16:15 Edited at: 30th Jul 2011 16:16
Ok, can you post a short piece of code that duplicates your problem, and I'll get it fixed.

[EDIT]Someone already has CSGames, so you'll need to pick another name.

CSGames94
18
Years of Service
User Offline
Joined: 27th Dec 2007
Location:
Posted: 30th Jul 2011 23:03
Here it is:


Quote: "Someone already has CSGames, so you'll need to pick another name."
How about CSGames94?
CSGames94
18
Years of Service
User Offline
Joined: 27th Dec 2007
Location:
Posted: 3rd Aug 2011 21:06
Okay, I went with saving the data individually and came out successfull! Thanks for the help!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Aug 2011 23:15
I've found and fixed the bug and it'll be in the next release.

CSGames94
18
Years of Service
User Offline
Joined: 27th Dec 2007
Location:
Posted: 5th Aug 2011 05:59
Quote: "I've found and fixed the bug and it'll be in the next release."
Okay, thanks again!

Login to post a reply

Server time is: 2026-07-10 10:19:43
Your offset time is: 2026-07-10 10:19:43