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 

Possible bug with Case Sensitivity

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



Joined: 19 Oct 2004
Posts: 102

PostPosted: Sun May 01, 2005 11:54 pm    Post subject: Possible bug with Case Sensitivity Reply with quote

It seems that the case sensivity is not working correctly when comparing strings in function form:

Code:
STRINGCASESENSE, On
a=t
b=T
If (a=b)
  MsgBox, Yes


This code yields 'Yes', whereas this code:
Code:
STRINGCASESENSE, On
a=t
b=T
If a=%b%
  MsgBox, Yes

does not, as expected.


C
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Mon May 02, 2005 10:51 am    Post subject: Reply with quote

Although this behavior might seem counterintuitive, it's intentional. It was done this way so that it's possible to have a case insensitive comparison inside the same expression with a case sensitive one. This is documented in the fineprint of the operator table: "The == operator behaves identically to = except when either of the inputs is not a number, in which case == is always case sensitive and = is always case insensitive."
Back to top
View user's profile Send private message Send e-mail
CarlosTheTackle



Joined: 19 Oct 2004
Posts: 102

PostPosted: Mon May 02, 2005 11:00 am    Post subject: Reply with quote

Ah, that wretched fine print again.



Thanks Chris,


C.
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Mon Apr 30, 2007 11:30 am    Post subject: Reply with quote

Chris wrote:
"The == operator behaves identically to = except when either of the inputs is not a number, in which case == is always case sensitive and = is always case insensitive."


It would be nicer if a Related link was provided in StringCaseSense. I lost two hours before I opted to search the forum.

Thank You. Smile
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Mon Apr 30, 2007 11:38 am    Post subject: Reply with quote

The StringCaseSense page was recently updated; so it's possible you don't have the latest version. It says, "This setting applies to: Expression comparison operators (except ==)."

So I think it's pretty clear now. If it isn't, please suggest specific changes to the wording.
Back to top
View user's profile Send private message Send e-mail
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Mon Apr 30, 2007 12:21 pm    Post subject: Reply with quote

Chris wrote:
it's possible you don't have the latest version.


True Sad , I have been using 1.0.46.09.

It is very clear now.

Thank you. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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