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.

Newcomers DBPro Corner / Limitations of SAVE ARRAY?

Author
Message
Rwilson
21
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 16th Sep 2003 02:45
I am attempting to save a user defined type array, and am encountering an error concerning it's type. The exact error is "Runtime Error 54 - Array Type Is Invalid". If it is indeed the case that one can not save UDT arrays, what can be done to achieve the same results?

Regards,
Ryan Wilson
zzabb
21
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 16th Sep 2003 05:33
without posting code its hard to see what problems you are having

Well I’m not sure what you mean by ‘user defined array’
All arrays are user defined
To make an array you first need to set the dimensions of an array

Dim nameofarray(sizeofarray)

It would look like:

Dim hitpoints(16)
Or
Dim hitpoints(16,16,16)

Where hitpoints is the name and 16 is the size

To save data to your array

X=1
Hitpoints(x)=10
Or
Hitpoints(x,0,0)=10
Or
Hitpoints(0,x,0)=10
or
Hitpoints(0,0,x)=10

Where x will be the place value for the number 10

To read the array

A=hitpoints(1)
Or
A=hitpoints(1,0,0)
or
A=hitpoints(0,1,0)
or
A=hitpoints(0,0,1)


Where A will be the value that you put in the 1 place

The only time I get the error you get is when I have either called an array position that doesn’t exist or made a typing error with the name of the array

Hope this helps

My advice is free -
unfortunately you get what you pay for (-:
Rwilson
21
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 16th Sep 2003 06:43
What I mean by User Defined Type Array is this:

Type YO
huh AS INTEGER
WHAT AS INTEGER
EndType

dim Saythatagain(5) AS YO

save array saythatagain.txt,Saythatagain(0)

That is pretty much what I'm trying to do, although in much more detail.
zzabb
21
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 16th Sep 2003 07:01
i'm sorry thats beyond me

My advice is free -
unfortunately you get what you pay for (-:
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Sep 2003 10:15
It's not possible. If you want to save a UDT array you have to do it the long way ... DIY
Rwilson
21
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 16th Sep 2003 17:54
If I could ask, what eaxactly IS the long way? I can imagine it requires using the file commands, but I'm afraid the cocepts of how to use them evades me. Could you give me a example in code?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Sep 2003 19:35 Edited at: 16th Sep 2003 19:36
post deleted by CattleRustler

-RUST-
haggisman
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 16th Sep 2003 19:42
Funnily enough the file commands are actually quite simple once you first use them. Heres a little example: -

Rwilson
21
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 16th Sep 2003 20:17
By golly, your right! They look much simpler now that I see how one uses them. Thank you very much, HaggisMan!

Regards,
Ryan Wilson

Login to post a reply

Server time is: 2024-11-25 08:41:15
Your offset time is: 2024-11-25 08:41:15