Jump to content

Need Stringinstr help


Recommended Posts

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)

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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!

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...