Sign in to follow this  
Followers 0
Max in montreal

StringInStr

2 posts in this topic

If StringInStr("$max[1][0]", "$table[1][0]") = 1 Then WinMove("untitled -", "", 0, 0, 200, 200)

i am trying to check if a string in the title of table, exists in max... i dont think it is working, can anyone tell me where my error is?

Share this post


Link to post
Share on other sites



If StringInStr("$max[1][0]", "$table[1][0]") = 1 Then WinMove("untitled -", "", 0, 0, 200, 200)

i am trying to check if a string in the title of table, exists in max... i dont think it is working, can anyone tell me where my error is?

Take off the " = 1 " part. StringInStr() returns 0 if the search string is not found, other wise it returns the character position NOT a 1 (unless it coincidentally happens to be at character position 1). So StringInStr("ABCDEFGHIJK", "DEF") returns 4, not 1. If you leave the value off, it becomes a boolean test. The 0 is False, and anything non-zero is True.

So your line becomes:

If StringInStr("$max[1][0]", "$table[1][0]") Then WinMove("untitled -", "", 0, 0, 200, 200)

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
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
Sign in to follow this  
Followers 0