Jump to content

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.

Link to comment
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.

Post your code.

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

Link to comment
Share on other sites

  • Moderators

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 :lmao:

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.

Link to comment
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]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...