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 / Typed Array Question

Author
Message
SirReal
23
Years of Service
User Offline
Joined: 20th May 2003
Location:
Posted: 15th Jun 2003 20:07
I'm hoping this is just an issue with the DBP demo ( RGT issues... grr ) but is it possible to use save and load array that are Typed.

My test code is below:


Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 15th Jun 2003 20:15
As you have discovered you cannot save a typed array.

You can save the array by

open file for write

creating a loop that writes each element of the type
for i = 1 to last element
write myarray(i). element1
write myarray(i). element2
next i

close the file

reading same basic outline for syntax

simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 15th Jun 2003 20:17
as far as I know, you cant have a combined array. I mean that an array has to be values OR text, not both ( unless you used the VAL command ? - just an idea )

so :
dim File_players$(20) - ( name )
dim file_players(20) - ( last played )

I dont think the format that you have in your post will work ? - I may be wrong, but I never have tried it..

file_players(1).name.. ?

I`m not sure...

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Jun 2003 20:27
It does work (simonuk74), and that is the way to do it (Codger)

Here is the complete code - with a bonus that the code will redim the array on loading it to make it the correct size

Login to post a reply

Server time is: 2026-07-17 19:33:56
Your offset time is: 2026-07-17 19:33:56