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 / Looping through arrays...

Author
Message
JazW
17
Years of Service
User Offline
Joined: 14th Jun 2007
Location:
Posted: 15th Jun 2007 22:49
Please could someone explain why this works:



But this produces an illegal object number error on the line "cX=object position x(cI)"...

JazW
17
Years of Service
User Offline
Joined: 14th Jun 2007
Location:
Posted: 17th Jun 2007 23:03
Thanks for replying, this is giving me a headache

But I have to disagree!

Array count is supposed to return the number of items, not the last index, and if you do this:

dim myarray(5)
print array count(myarray())

You get 5 - the number of items, not 4 - the last index.
JazW
17
Years of Service
User Offline
Joined: 14th Jun 2007
Location:
Posted: 18th Jun 2007 02:05
Ah it was a stupid mistake!

dont: dim myarray(0) as myobject

do: dim myarray(-1) as myobject

Login to post a reply

Server time is: 2024-11-25 17:57:36
Your offset time is: 2024-11-25 17:57:36