LovinItAll Posted February 26, 2006 Posted February 26, 2006 I am trying to find the number of occurences of a string within the body tags of an HTML page. There will always be at least one and less than 22: (the code below is just one of many things I have tried. I also tried a Do loop -- which I think is what I want -- but no worky) Func NumberOfStrings() $StringToSearch = _IEBodyReadHTML($o_IE) $x = 1 $y = 1 For $y = 1 to 22 StringInStr ($StringToSearch, "MySubString", 0, $x) $x = $x + 1 If @error = 1 Then ; StringInStr() failed $y=22 EndIf Next SplashTextOn("Instances of MySubString", $x) sleep(10000) EndFunc
LovinItAll Posted February 26, 2006 Author Posted February 26, 2006 Never mind -- I figured it out. I need to stop messing with this stuff at 4 AM!
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