Thread: vbscript help
View Single Post
Old 2008-11-11, 06:16   #7
Patrick123
 
Patrick123's Avatar
 
Jan 2006
JHB, South Africa

157 Posts
Default

The other option I would do is to change your construct:

Code:
if Left(str_CurrentLine,5) = "user=" Then
....
End if

if Left(str_CurrentLine,1) = "[" Then
....
End if

If inStr(1,str_CurrentLine,"not prime.") Then
....
End if

If inStr(1,str_CurrentLine,"prime!") Then
....
End if
With the construct:

Code:
if Left(str_CurrentLine,5) = "user=" Then
....

ElseIf Left(str_CurrentLine,1) = "[" Then
....

ElseIf inStr(1,str_CurrentLine,"not prime.") Then
....

ElseIf inStr(1,str_CurrentLine,"prime!") Then
....
End if
This would ensure you don't carry on checking the line once one of the conditions has been met.

Regards
Patrick
Patrick123 is offline   Reply With Quote