COMX Club Forum
http://www.comxclub.hobby-site.com/forum/

Assignment of truth values in BASIC
http://www.comxclub.hobby-site.com/forum/viewtopic.php?f=8&t=29
Page 1 of 1

Author:  carlsson [ Thu Sep 16, 2021 2:06 pm ]
Post subject:  Assignment of truth values in BASIC

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.

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/