00 Votes

Delphi "is not"-Syntax does not work

Question by Guest | 2013-10-31 at 20:07

I want to do the following with Delphi (negation of is):

if Sender is not TListView then ...

However, this solution is not working. What am I doing wrong? I always get the following error message:

Error: Illegal Expression

I do not want to write something like this:

if Sender is TListView then begin end else ...

But I do not have any other idea.

ReplyPositiveNegative
0Best Answer0 Votes

In Lazarus and Delphi there is no "is not".

Instead, you should use "if not":

if not (Sender is TListView) then ...

That should do it. Writing the "not" directly behind the "if" is only possible in spoken language.
2013-10-31 at 22:23

ReplyPositive Negative
Reply

Related Topics

Delphi: System-Wide HotKey

Tutorial | 1 Comment

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.