Is there a way to do this? Many languages can, but not qb64. I may be missing it, as I am working on other parts of the app, just got stumped
Title: Re: Arrays not allowed in user defined TYPE
Post by: SMcNeill on December 03, 2018, 07:17:58 pm
There's ways to work around the issue, but none are really simple to implement. Oftentimes, the best solution is multiple calls to PUT/GET to save your game data.
Type a X as integer Y as double Z as string * 10 END TYPE
Dim example AS a DIM array(1 to whatever, 1 to whatever2)
Then when saving the data, save it with:
PUT #1, , example 'save the main type data PUT #1, , array() 'save the array info directly
To get the data back, just do the same with GET instead of PUT
Title: Re: Arrays not allowed in user defined TYPE
Post by: xra7en on December 05, 2018, 11:07:33 am
KLUDGE way. I am using this for now - works. Later when my game is done, I'll revisit it
I am looking into the PHP (UN/SERIALIZE) version of this, but for right now I simplified it (CUZ Im in a hurry LOL)
Messy? Yes, but obviously this can be cleaned up. but for something temporary for testing, this works well. opinions? suggestions? Love to hear them..Thanks!!
Title: Re: Arrays not allowed in user defined TYPE
Post by: Pete on December 05, 2018, 01:17:45 pm
Speaking of QB64 functions, did you know you could keep the string intact while parsing it by adding a seed to the INSTR statement?