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 

How do I get IfInString to search for a comma

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
EdScriptNewbie



Joined: 20 Jan 2007
Posts: 110

PostPosted: Fri Jul 10, 2009 1:15 am    Post subject: How do I get IfInString to search for a comma Reply with quote

I want to find out if there's a comma in a string.
`, didn't seem to work

thanks!
_________________
...Ed
Back to top
View user's profile Send private message
1993t
Guest





PostPosted: Fri Jul 10, 2009 1:20 am    Post subject: Re: How do I get IfInString to search for a comma Reply with quote

Use a variable. e.g

Code:
var = ,
string = lol, lol
IfInString, string, %var%
{
MsgBox, yes
}
else
{
MsgBox, no
}
Back to top
sinkfaze



Joined: 18 Mar 2008
Posts: 5044
Location: the tunnel(?=light)

PostPosted: Fri Jul 10, 2009 1:41 am    Post subject: Reply with quote

Escaping the comma works fine for me:

Code:
string = lol, lol
IfInString, string, `,
  MsgBox, yes

_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
1993t
Guest





PostPosted: Fri Jul 10, 2009 5:04 am    Post subject: Reply with quote

sinkfaze wrote:
Escaping the comma works fine for me:

Code:
string = lol, lol
IfInString, string, `,
  MsgBox, yes


I suppose, but the variable method is just another way of doing it if he can't get it right.
Back to top
smikkelsen



Joined: 24 Jun 2008
Posts: 104

PostPosted: Fri Jul 10, 2009 6:41 am    Post subject: Reply with quote

Quote:

Escaping the comma works fine for me:


Me too.


There is no reason to have extra code. I hate messy code...
_________________
“Whenever I'm about to do something, I think, 'Would an idiot do that?' And if they would, I do not do that thing.”

-Dwight
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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