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 / Problem with Arrays in Arrays in Functions

Author
Message
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 23rd Oct 2002 18:08
The following code illustrates an odd problem with arrays in functions.
The array element 'a(1)' contains 1, using this as the index on 'b()' outside of the function sets the correct element, inside the function 'a(1)' still contains 1 but using it as an index on 'b()' sets element 'b(0)' instead.

I can get round it by assigning a(1) to another variable first, but I thought I should bring it to peoples attention.


dARKNER
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: Sweden
Posted: 23rd Oct 2002 18:30
I can confirme above ... thus if you use b(int(a(1))) = 20
it works .. .. strange . ...

Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 23rd Oct 2002 19:13
Thanks for the confirmation, its always good to know its not just me.

Login to post a reply

Server time is: 2024-04-27 04:45:31
Your offset time is: 2024-04-27 04:45:31