View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default When does TRUE evaluate to minus 1?

You can either use CInt to convert it to an integer, or do some
arithmetic with it. E.g.

Dim Res As Integer
Res = CInt(5 = (50 / 10))
Debug.Print Res
' or
Res = (5 = (50 / 10)) + 0
Debug.Print Res


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"davidm"
wrote in message
...

I want to exploit the fact TRUE equtes to -1 but cannot get my
head
around the conditions surrounding this. I have experimented in
code
with MsgBox (5=(50/10)) , or some such direct equality , but
each time
simply get the result TRUE.

How can I wrest *minus 1* from a TRUE boolean relationship?


--
davidm
------------------------------------------------------------------------
davidm's Profile:
http://www.excelforum.com/member.php...o&userid=20645
View this thread:
http://www.excelforum.com/showthread...hreadid=390606