# array error, need to prevent error msg

## Recommended Posts

below is an example i made up:

dim somearray[1][5]

now say that array was full of values and you wanted to check the value.

for x =1 to endofarray

for j =1 to end of 2nd dimsion

if array[x][j] = "one" And array[x+2][j] = "two" then

xxx

endif

if array[x][j] = "one" And array[x+1][j-1] = "three" then

xxxxx

endif

now the problem is when i am comparing if array[x][j] ([x+...]) what if when i added x+2.. but the current value of x was 1.. it will through out error.. array sub dimsions or whatever exceeded.

I want it not to say that instead i want it to say that that statement if false...

how do i go about doing that without checking the current size of array... before using if.. as this would take too long for me to implement.

i mean i am asking the compiler to check if somearray[ x+2 ] [j+10] = "..." if that dimsion doesnt exist then this statement is false.. so why though out an error.

if you can help please do so, i hope you understand what i am saying.

##### Share on other sites

below is an example i made up:

dim somearray[1][5]

now say that array was full of values and you wanted to check the value.

for x =1 to endofarray

for j =1 to end of 2nd dimsion

if array[x][j] = "one" And array[x+2][j] = "two" then

xxx

endif

if array[x][j] = "one" And array[x+1][j-1] = "three" then

xxxxx

endif

now the problem is when i am comparing if array[x][j] ([x+...]) what if when i added x+2.. but the current value of x was 1.. it will through out error.. array sub dimsions or whatever exceeded.

I want it not to say that instead i want it to say that that statement if false...

how do i go about doing that without checking the current size of array... before using if.. as this would take too long for me to implement.

i mean i am asking the compiler to check if somearray[ x+2 ] [j+10] = "..." if that dimsion doesnt exist then this statement is false.. so why though out an error.

if you can help please do so, i hope you understand what i am saying.

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

##### Share on other sites

edit: removed code.. due to slow forum reponse.. ill just work it my self.

Edited by pingpong24

##### Share on other sites

Time Posted Code: 3:28 PM my time

Time Removed Code: 3:32 PM my time

Wow... 4 minutes to get a response.... yeh... I'd suggest you to work it yourself then

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

##### Share on other sites

Wow... 4 minutes to get a response....

I took pingpong24 to mean that the server running the forum software was slow to upload what may have been a very large block of code... I do not think that pingpong24 was speaking about humans being slow to post a reply.

I'm off to go get another injection of pessimism... those comments do not sound like me :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...