Sign in to follow this  
Followers 0
Jury

Why doesn't this work as stated?

4 posts in this topic

This code always returns a $result of 10 which isn't correct is it? The third occurance starts at 44 doesn't it?

Jury

$result = StringInStr("How much wood could a woodchuck chuck is a woodchuck could chuck wood?", "wood", 0, 3) ; Find the 3rd occurance of "wood"
MsgBox(0, "Search result:", $result)

Share this post


Link to post
Share on other sites



I get 44

Share this post


Link to post
Share on other sites

I get 44 too


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hmmm, something tells me you ran this from the helpfile and got 10 becase THIS returns 10

$result = StringInStr("I am a String", "RING")
MsgBox(0, "Search result:", $result)

but thats the first example in that example, the one you posted does actually give 44...

Edited by colafrysen

[font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size]

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