| View previous topic :: View next topic |
| Author |
Message |
tuna
Joined: 03 Oct 2007 Posts: 40 Location: Bristol, England
|
Posted: Wed Mar 12, 2008 12:40 am Post subject: If var is type bug |
|
|
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 |
|
 |
tic
Joined: 22 Apr 2007 Posts: 1332
|
Posted: Wed Mar 12, 2008 12:48 am Post subject: |
|
|
| Quote: | | Note: The operators "between", "is", "in", and "contains" are not supported in expressions. |
|
|
| Back to top |
|
 |
tuna
Joined: 03 Oct 2007 Posts: 40 Location: Bristol, England
|
Posted: Wed Mar 12, 2008 12:55 am Post subject: |
|
|
| 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 |
|
 |
tic
Joined: 22 Apr 2007 Posts: 1332
|
Posted: Wed Mar 12, 2008 1:21 am Post subject: |
|
|
&& is an expression
if something and somethingelse
that is an expression. this isnt a bug. it is documented and well know. |
|
| Back to top |
|
 |
|