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 / Quick Array Question

Author
Message
Vandetta
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 21st Oct 2003 10:32
Ok when I make an array...say array(5,5) what is the first element (0,0) or (1,1)? And what is the last (4,4) or (5,5)? Thanks.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Oct 2003 11:46
First item = 0,0
Last item = 5,5
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 21st Oct 2003 15:02
You sure, Ian? That would mean a 5x5 array has 36 elements.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 21st Oct 2003 16:01
Yes its correct. You can also exceed the array limits (although you shouldn't for obvious reasons).


Avatar & Logo by Indi. Insert witty comment here...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Oct 2003 21:12
Am I sure? Me? The writer of the array plugin? Are you serious?

Yes, I'm sure
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Oct 2003 22:01
lol. But in most other languages array(5) would be 0-4, right?
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 21st Oct 2003 22:15
Wrong.

Not in any language I've used anyway.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Oct 2003 22:23
In C, C++, and Pascal, the answer is yes.
Vandetta
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 22nd Oct 2003 13:51
Hehe, thanks guys

Login to post a reply

Server time is: 2026-07-26 05:22:29
Your offset time is: 2026-07-26 05:22:29