A quick lesson on: What is IMP?
#14
I think the biggest problem with IMP is that folks think of it logically, and not programmatically. 

In logic, we can say something such as NOT TRUE = FALSE.  When coding, however, that statement doesn't hold true, *except in very limited situations*.

NOT -1 = 0.  In this case, -1 is TRUE and 0 is FALSE, so the statement NOT TRUE = FALSE is correct.

But what if we NOT a different value?

NOT -2 = 1.  In this case -2 is TRUE, and 1 *is also* TRUE. 

NOT (a true condition) is *ONLY* a FALSE condition, when that condition is -1.  In all other cases, it's still TRUE.

Logically, we think that NOT TRUE is FALSE, but when coding, that's only accurate in the limited condition that our truth value is -1.  One could break the logic down just as simple to:

IF A = -1 THEN
  'NOT A is FALSE
ELSE
    'NOT A is TRUE
END IF

----------------------------

IMP breaks down to the same type of simplified logic.  When dealing with A IMP B, it's:

IF A =-1 AND B = 0 THEN
  'A IMP B is FALSE
ELSE
    'A IMP B is TRUE
END IF
Reply


Messages In This Thread
A quick lesson on: What is IMP? - by SMcNeill - 05-02-2022, 12:35 AM
RE: A quick lesson on: What is IMP? - by SMcNeill - 05-09-2022, 02:54 AM
RE: A quick lesson on: What is IMP? - by Dimster - 07-27-2022, 01:42 PM
RE: A quick lesson on: What is IMP? - by SMcNeill - 07-27-2022, 02:32 PM
RE: A quick lesson on: What is IMP? - by Dimster - 07-27-2022, 05:22 PM
RE: A quick lesson on: What is IMP? - by SMcNeill - 07-27-2022, 07:03 PM
RE: A quick lesson on: What is IMP? - by SMcNeill - 07-27-2022, 07:27 PM
RE: A quick lesson on: What is IMP? - by Pete - 07-27-2022, 07:37 PM
RE: A quick lesson on: What is IMP? - by SMcNeill - 07-27-2022, 07:59 PM
RE: A quick lesson on: What is IMP? - by Pete - 07-27-2022, 10:14 PM
RE: A quick lesson on: What is IMP? - by Dimster - 07-28-2022, 12:51 PM
RE: A quick lesson on: What is IMP? - by SMcNeill - 07-28-2022, 04:34 PM
RE: A quick lesson on: What is IMP? - by Dimster - 07-28-2022, 04:53 PM
RE: A quick lesson on: What is IMP? - by JRace - 07-28-2022, 05:38 PM
RE: A quick lesson on: What is IMP? - by JRace - 11-05-2022, 03:50 AM
RE: A quick lesson on: What is IMP? - by vince - 11-10-2022, 06:56 AM



Users browsing this thread: 4 Guest(s)