Is there any way to assign truth values in either 1802 based BASIC?
I mean on other home computers you can use something like A = A - (B=C) which means A will increase only in case B=C. Most Microsoft variants evaluate true = -1 and false = 0, while a few like Atari, Sinclair, Acorn (?) use values +1 and 0.
But on e.g. Comx BASIC and all the other 1802 ones I've tried including Telmac, Cosmac Elf etc, this generates a syntax error.
I kind of came up with a solution involving SGN(B-C) etc which works in some cases but is not universal.
Did I miss something or does ever 1802 based BASIC lack the ability to assign and use the result of comparisons in further calculations?
Yes, I'm having a long-term goal to learn enough Comx BASIC to enter next year's 10 Liner BASIC contest but without this ability it looks like somewhat limited entries if one has to waste one IF statement for every such case, in particular as I understand that ELSE is not implemented.
|