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 / Errors with Arrays?

Author
Message
Overdroid
17
Years of Service
User Offline
Joined: 22nd Sep 2002
Location:
Posted: 22nd Sep 2002 12:44
Hello all,
this is my first post here at the new DBP forums. Howdy.

I think I've seen it mentioned elswhere, but has anyone else had any problems using the new array system? For example the following code produces 0 as output:

dim test(5)
print array count(test(0))
sync
wait key
end


Anyone else have this issue? Shouldn't the answer be 5?

And this code:

dim test$(5)
print array count(test$(0))
sync
wait key
end


Won't compile for me. I get a "cannot perform 'dword' cast on type '@test$(0)' at line 7" error.

Also, the description of the UAS seems to be missing some info:
I assume commands like ARRAY INDEX TO TOP set the array index to the top of the stack (if you're using the array as a stack), but what's the syntax for retrieving from or assigning to the array element that the index is pointing to?
"Talk is cheap because supply exceeds demand."
- Unknown.

Login to post a reply

Server time is: 2019-11-17 15:03:13
Your offset time is: 2019-11-17 15:03:13