Joined: 21 Nov 2009 Posts: 58 Location: California
There have been no postings for a while, so here's a tidbit from my Tips'n'Techniques collection.
A LOGICAL variable can have only one of two values: False or True, represented internally as H'00' and H'01', respectively. On a typical report or form, you would expect to see a blank or 'X', and that's how Natural displays them by default.
Here is a very simple program to display Natural's default values. Note that even integers (0 in the right-most bit) are considered "false" and odd integers (1 in the right-most bit) are considered "true".
DEFINE DATA LOCAL
1 #I (I1) 1 REDEFINE #I
2 #L (L)
FOR #I = 1 5
And here is the output:
The Xs in the #L column represent "true". Using an edit mask, it's a very simple matter to make reports more self-explanatory.
Add a simple edit mask
Get a little fancier and more legible with
Use quoted strings for mixed case:
Of course the logical need not be limited to True and False.