Jump to content
Sign in to follow this  
SlimShady

Problems With For...next And While...wend

Recommended Posts

SlimShady

I've got a problem. My For... doesn't work anymore.

I replaced the For... with While...WEnd.

It says:

Error: "Wend" statement with no matching "While" statement

The same thing with For....

Can someone look:

Func SearchAND($ReadLine)
$FoundNum = 0

;======Start MultiWords
If $MultiWords = "Yes" Then

;=====Start searching each word
$num = 1

While $i <= $Words[0]
;=====Check match
$Found = StringInStr($ReadLine, $Words[$num])

If $Ignore[0] > 0 Then
$num = $Ignore[0] + 1

$Ignore[$num] = StringInStr($ReadLine, "Temporary Internet Files")

$exc = 1
Do
$Ignore = StringInStr($ReadLine, $Ignore[$exc])
;=======Ignore certain words
If $Ignore > 0 Then $Found = 0
$exc = $exc + 1
Until $exc = $Ignore[0]

If $Found > 0 Then
$FoundNum = $FoundNum + 1
EndIf

;========End searching for words
$i = $i + 1
WEnd

If $FoundNum = $Words[0] Then
$Found = 1
$FoundSomething = "yes"
Else
$Found = 0
EndIf

;=======If not MultiWords.........
Else

;=====Check match
$Found = StringInStr($ReadLine, $Words)

$Ignore = StringInStr($ReadLine, "Temporary Internet Files")

If $Ignore > 0 Then $Found = 0

EndIf
EndFunc

Share this post


Link to post
Share on other sites
SlimShady

Thanks it works. :D

Edited by SlimShady

Share this post


Link to post
Share on other sites
scriptkitty

btw, you would have the same issue with for...next and do..until. Same type error would come up.


AutoIt3, the MACGYVER Pocket Knife for computers.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.