zig05 Posted June 21, 2006 Posted June 21, 2006 I am trying to get autoit to search for the location of a string within a string. My syntax won't work. It doesn't find my variable $shortaddress in the string $pagedata even when it is there. Does anybody know what I am doing wrong. (probably alot) Thanks so much for any help. $addressposition = Stringinstr($pagedata, $shortaddress, 0, 1)
jlorenz1 Posted June 21, 2006 Posted June 21, 2006 I think we all need further information. Perhaps the variable is a number not string. Perhaps the variable isn't configured properly. Difficult to help. Greetings from Germany Johannes Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]
MHz Posted June 21, 2006 Posted June 21, 2006 The last 2 parameters are optional and since you are setting them to default, then omit them. This simple example shows the position as shown in the Msgbox. $pagedata = '1234567890' ; Change to any integer in the string to test $shortaddress = '7' $addressposition = Stringinstr($pagedata, $shortaddress) ; Show result MsgBox(0, '$addressposition', $addressposition)
zig05 Posted June 21, 2006 Author Posted June 21, 2006 YOU ARE THE GREATEST! It may seem like it was a retarded question, but I had tried reformatting that thing a dozen different ways. Dropping the last two parameters fixed it!!! Thanks so much!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now