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 

If var is type bug

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



Joined: 03 Oct 2007
Posts: 40
Location: Bristol, England

PostPosted: Wed Mar 12, 2008 12:40 am    Post subject: If var is type bug Reply with quote

Hi, I just noticed a strange behaviour when evaluating var type - i've just checked this with alpha and number at the moment, but I've found that zero isn't always evaluated as type number when evaluated in conjuction with something else like with && though it evaluates fine on its own like "if varcontainingzero is number", like in the example below:

Code:
a = 0 ; change it to 1 and see what you get
b = alpha

if ((a is number) && (b is alpha))
   msgbox "%a%" is number when being evaluated with another expression.
else
   msgbox "%a%" is not number when being evaluated with another expression.

if a is number
   msgbox But "%a%" is number using single evaluation...
Exit


Try it out, see what you get...

Many thanks
Back to top
View user's profile Send private message
tic



Joined: 22 Apr 2007
Posts: 1332

PostPosted: Wed Mar 12, 2008 12:48 am    Post subject: Reply with quote

Quote:
Note: The operators "between", "is", "in", and "contains" are not supported in expressions.
Back to top
View user's profile Send private message
tuna



Joined: 03 Oct 2007
Posts: 40
Location: Bristol, England

PostPosted: Wed Mar 12, 2008 12:55 am    Post subject: Reply with quote

Yes, I see, though would that count as an if (expression) in the first place? I mean, certainly "if var is type" and "if (var is type)" both evaluates correctly, surely it logically follows that "if (var1 && var2) is type" should also evaluate correctly. Also, it is a little odd that such expreeions can be used successfully in this way as if by design except in the instance of a zero.
Back to top
View user's profile Send private message
tic



Joined: 22 Apr 2007
Posts: 1332

PostPosted: Wed Mar 12, 2008 1:21 am    Post subject: Reply with quote

&& is an expression

if something and somethingelse

that is an expression. this isnt a bug. it is documented and well know.
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