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 Discussion / arrays excepting strings

Author
Message
Plugged
22
Years of Service
User Offline
Joined: 30th Nov 2002
Location: Hertfordshire
Posted: 8th Sep 2004 04:19
well like the title says how do you get an array to except a string.
the help file says it can be done but when i try it gives me

Quote: "ARRAY MUST HAVE A SUBSCRIPT AND ASSIGNMENT VALUE"


can any one help?

cheers
plugged


Work Hard; Play Harder ;
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 8th Sep 2004 05:01
Numeric arrays are not supposed to accept strings, for the code that accesses their values is different from a string itself. However, there are also string arrays that you can use, as in;

dim a$(5)

a$(1) = "Hello,"
a$(2) = "my"
a$(3) = "name"
a$(4) = "is"
A$(5) = "Grok."

You simply cannot mix the two types in DBC, numeric arrays must contain numbers and string one must contain strings.

S.

Any truly great code should be indisguishable from magic.

Login to post a reply

Server time is: 2025-05-24 21:32:20
Your offset time is: 2025-05-24 21:32:20