AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IfNotInString Broken?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
alaricljs



Joined: 06 May 2005
Posts: 15

PostPosted: Mon May 09, 2005 8:28 pm    Post subject: IfNotInString Broken? Reply with quote

Code:
Loop %Images%\*.*, 0, 0
{
  IfNotInString %A_LoopFileAttrib%, H
    NumImages ++
}
MsgBox %NumImages% images


Do this on a WinXP box with 3 images in the %Images% folder. You will get a response of 4 images. For some reason Thumbs.db is not getting flagged by the IfNotInString....

In fact, simplify things alot:
Code:
IfNotInString ASH, H
MsgBox Wtf?


Ooh-weeeee-ooooooooh [cue Twilight Zone]

Edit: Ok, I'm just double checking myself cuz I hate to look like an idiot...

Code:
IfInString ASH, H
MsgBox This SHOULD fire

IfNotInString AFSDF, H
MsgBox This SHOULD fire too

IfInString ASH, X
MsgBox This SHOULD NOT fire

IfNotInString DSJKFH, F
MsgBox This SHOULD NOT fire too


I sure hope the above code is correct, on the other hand when I run it the 2 MsgBox's that pop are the 2nd and 4th (the one's with "too")

Am I suffering from delusions?
_________________
Spoon!
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Mon May 09, 2005 9:54 pm    Post subject: Reply with quote

IfNotInString is one of the commands that causes confusion because its first parameter cannot be the literal text you want to search. Instead, it must be the name of a variable whose contents will be searched.
Back to top
View user's profile Send private message Send e-mail
alaricljs



Joined: 06 May 2005
Posts: 15

PostPosted: Tue May 10, 2005 2:35 pm    Post subject: Reply with quote

Hmmm, so I get to look stupid anyhow.

Thanks Chris, next time I will stare at the documentation until I reeeeally get it. Especially since no one has ever complained about this before... I should have figured I was just missing the point.
_________________
Spoon!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group