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 / NooB ? about arrays

Author
Message
Palemos
21
Years of Service
User Offline
Joined: 22nd Apr 2003
Location:
Posted: 22nd Apr 2003 20:54 Edited at: 22nd Apr 2003 20:56
Greeting Palemos here. Completly new to DBPro...I have some VB and PB background. I was doing some testing on arrays and found this: See Source.

Does the compiler not check for out of range arrays? Who can tell me what this INT of 11472504 is? No matter how I define the out of range array (5,2) or (3,9) I get this INT.

Thanks

Redostrike
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Belgium
Posted: 22nd Apr 2003 21:50
Hi and welcome to the forum. I've tryed this in DB Classic and it says array out of range just to tell you.

Only heroes live forever
just a ji
21
Years of Service
User Offline
Joined: 13th Apr 2003
Location:
Posted: 22nd Apr 2003 22:10
have you upgraded to patch 4?

there are 10 kinds of people.. those who understand binary logic, and those who don't.
Stevo
22
Years of Service
User Offline
Joined: 4th Oct 2002
Location:
Posted: 23rd Apr 2003 01:17
Hi Palemos, what it means is you are trying to call, ie, use the array in a position that is above the number of elements you have allowed.

for
dim t(5)

you only have 5 positions/elements, actually you have six because in
arrays you can also use the 0 position.

you could go

for x= 1 to 5
t(x)=5
next x

the t is for the name of your array and the x in brackets is for the element in the array. the way it works is that the x in brackets is the same x as in the for to loop, so that is going from 1 to 5. in the end each of the elements in your array will equal 5

Login to post a reply

Server time is: 2024-11-24 11:14:11
Your offset time is: 2024-11-24 11:14:11