Sujet : Re: basic BASIC question
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 01. Feb 2025, 01:33:54
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <679d6bf1$0$713$14726298@news.sunsite.dk>
References : 1 2 3 4 5 6
User-Agent : Mozilla Thunderbird
On 1/31/2025 6:42 PM, Craig A. Berry wrote:
On 1/31/25 4:05 PM, Dan Cross wrote:
Treating -1 as true in BASIC seems rather common, from the quick
survey I did; I speculate that this is almost certainly due to
the bit representation of -1 having all bits set, while in BASIC
the integer type is (usually?) signed, thus -1 on a two's
complement machine. I wonder what the original DTSS BASIC did?
I had a quick look at:
https://ia601901.us.archive.org/34/items/bitsavers_dartmouthB_3679804/ BASIC_4th_Edition_Jan68_text.pdf
and didn't see an obvious answer, though I didn't read the whole thing
and could've missed something. The exact values of true and false might
well have been considered an implementation detail that should not be
relied on.
Or maybe true and false did not exist.
I noted that the manual defined IF THEN as:
IF [formula] [relation] [formula] THEN [line number]
and not:
IF [formula] THEN [line number]
Arne