ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Why is Not not Not? (https://www.excelbanter.com/excel-programming/329638-re-why-not-not-not.html)

Bob Phillips[_7_]

Why is Not not Not?
 
Sure it's not because you have

irn = Not ir

--
HTH

Bob Phillips

"Paul Lautman" wrote in message
...
I've was having terrible trouble trying to figure out why I couldn't get
some OLE code to work with the IBM Personal Communications Emulator.

A lot of tracing through and I found that Not wasn't working.

In the code in the attached picture, if I un-comment the line "ir = True"
then everything works fine. But as it stands (and as the picture shows),
both ir and Not ir are both True!!!

If I code:

If oia.waitforinputready(10000) Then
Else
msg = "Initialisation (check Call Entry)"
GoTo toolong
End If

Then all works as expected. But if I code:

If Not oia.waitforinputready(10000) Then
msg = "Initialisation (check Call Entry)"
GoTo toolong
End If

Then the "True" leg is always executed???

Anybody got any ideas?

Just in case anyone doesn't get the attachment, I have placed it at

http://tinyurl.com/bhx57






Paul Lautman

Why is Not not Not?
 
But look at the Locals window.

It shows that ir = True and irn = True and yet the code sets irn = Not ir

Bob Phillips wrote:
Sure it's not because you have

irn = Not ir


"Paul Lautman" wrote in message
...
I've was having terrible trouble trying to figure out why I couldn't
get some OLE code to work with the IBM Personal Communications
Emulator.

A lot of tracing through and I found that Not wasn't working.

In the code in the attached picture, if I un-comment the line "ir =
True" then everything works fine. But as it stands (and as the
picture shows), both ir and Not ir are both True!!!

If I code:

If oia.waitforinputready(10000) Then
Else
msg = "Initialisation (check Call Entry)"
GoTo toolong
End If

Then all works as expected. But if I code:

If Not oia.waitforinputready(10000) Then
msg = "Initialisation (check Call Entry)"
GoTo toolong
End If

Then the "True" leg is always executed???

Anybody got any ideas?

Just in case anyone doesn't get the attachment, I have placed it at

http://tinyurl.com/bhx57






All times are GMT +1. The time now is 01:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com