|
In the ying/yang logical world of programming there exist two values: 0 / 1; off / on; no / yes; false / true.
In the world of MEDITECH Magic programming, we refer to this pair of choices as: FALSE / TRUE.
Logically, if something does not exist, we call this FALSE.
Logically, if something does exist, we call this TRUE.
In MEDITECH Magic logic there is only one value which will resolve itself as FALSE and that is NIL.
Consequently, if something isn't NIL, then it must be TRUE.
However, the world is not just a logical place, it is also a physical place. For any given relationship, then, there are two types of values: logical (false/true) and physical.
| Example |
Logical Value |
Physical Value |
| nil |
false |
nil |
| 5 |
true |
5 |
| 5+6 |
true |
11 |
| 5-5 |
true |
0 |
| 5*6 |
true |
30 |
| "ABC" |
true |
"ABC" |
| 5>6 |
false |
nil |
| 5<6 |
true |
5 |
To be or NOT to be?
The NOT operator reverses the TRUTH of the value. The NOT operator is an apostrophe ('). It is placed immediately prior to the value you wish to affect.
| Example |
Logical Value |
Physical Value |
| 'nil |
true |
'internal name of value' |
| 5^X,'X |
false |
nil |
| 5^X,6^Y,'(X+Y) |
false |
nil |
| 5^X,6^Y,'(X-X) |
false |
nil |
| 5^X,6^Y,'(X*Y) |
false |
nil |
| '("ABC") |
false |
nil |
| 5'>6 |
true |
5 |
| 5'<6 |
false |
nil |
|