Sujet : Re: basic BASIC question
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 01. Feb 2025, 02:01:15
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <679d725b$0$713$14726298@news.sunsite.dk>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 1/31/2025 7:38 PM, Dave Froble wrote:
On 1/31/2025 11:53 AM, Arne Vajhøj wrote:
On 1/31/2025 11:39 AM, Dave Froble wrote:
On 1/31/2025 10:18 AM, Arne Vajhøj wrote:
Is it common to use:
>
declare integer constant TRUE = -1
declare integer constant FALSE = 0
>
>
?
>
It works. Doesn't really matter if declared a constant. Zero is false,
anything else is true. Using 1 vs -1 has been more my experience.
>
I got the impression that the manual/compiler prefer -1 over 1.
Manuals usually have a preference, but, can be incomplete.
print not 0%
>
does print -1.
That is an operation to flip the bits. The opposite of 0000000000000000 is 1111111111111111 ...
Ah - yes. The manual say that NOT is bit wise but AND, OR and XOR
are logical.
<quote>
Operator Example Meaning
NOT NOT A% The bit-by-bit complement of A%. If A% is true (–1), NOT
A% is false (0).
AND A% AND B% The logical product of A% and B%. A% AND B% is true
only if both A% and B% are true.
OR A% OR B% The logical sum of A% and B%. A% OR B% is false only if
both A% and B% are false; otherwise, A% OR B% is true.
XOR A% XOR B% The logical exclusive OR of A% and B%. A% XOR B% is
true if either A% or B% is true but not if both are true.
</quote>
Arne