Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 5780

programming • Re: BASIC rules for IF THEN ELSE

$
0
0
I've spotted another 'must use THEN' situation:

Code:

10PRINT FNchk(TRUE)20PRINT FNchk(FALSE)30END40DEF FNchk(V%) IF V% THEN = "TRUE" ELSE = "FALSE"
Without the THEN you're, not unresaonably, rewarded with a "Type mismatch".

Edit: veering off-topic, I'm midly surprised to find it works with the program 'the other way around'. I'm not sure why I should be surprised, though:

Code:

10DEF FNchk(V%) IF V% THEN = "TRUE" ELSE = "FALSE"20PRINT FNchk(TRUE)30PRINT FNchk(FALSE)

Statistics: Posted by acheton1984 — Tue Dec 09, 2025 9:46 am



Viewing all articles
Browse latest Browse all 5780

Trending Articles