Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
pl can someone explain why the ansers are negative in the extract from the Immediate box thanks Tim ?true + true -2 ? True + TRUE -2 ?true + false -1 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tim
in VBA TRUE evaluates to -1 (opposed to 1 in Excel formulas) so in your case TRUE + TRUE = (-1) + (-1) = -2 and TRUE + FALSE = (-1) + 0 = -1 HTH Frank Tim Childs wrote: Hi pl can someone explain why the ansers are negative in the extract from the Immediate box thanks Tim ?true + true -2 ? True + TRUE -2 ?true + false -1 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Frank
many thanks - it seems bizarre on the one hand but it certainly explains the responses in the Immediate window regards Tim "Frank Kabel" wrote in message ... Hi Tim in VBA TRUE evaluates to -1 (opposed to 1 in Excel formulas) so in your case TRUE + TRUE = (-1) + (-1) = -2 and TRUE + FALSE = (-1) + 0 = -1 HTH Frank |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tim
That's because contrary to TRUE in Excel, which is 1, TRUE in VBA is -1 -- Best Regards Leo Heuser Followup to newsgroup only please. "Tim Childs" skrev i en meddelelse ... Hi pl can someone explain why the ansers are negative in the extract from the Immediate box thanks Tim ?true + true -2 ? True + TRUE -2 ?true + false -1 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tim,
False is 0 True is actually better thought of as NOT 0. In 8 bit binary: 00000000 = False 11111111 = True If that binary number for True is represented as a signed byte, it turns out to be -1 -- Rob van Gelder - http://www.vangelder.co.nz/excel "Tim Childs" wrote in message ... Hi pl can someone explain why the ansers are negative in the extract from the Immediate box thanks Tim ?true + true -2 ? True + TRUE -2 ?true + false -1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
if any of 3 conditions is true, then answer is true | Excel Worksheet Functions | |||
Search for 2 true arguments and return true or false | Excel Discussion (Misc queries) | |||
Function to return True/False if all are validated as True by ISNU | Excel Worksheet Functions | |||
How do I stop Excel from changing the word true to TRUE? | Excel Discussion (Misc queries) | |||
Reverse false and combine with true true value | Excel Worksheet Functions |