Closed nogoodboyo closed 4 years ago
May I ask what version you are using? Just type xcbasic64 -h
and it will print version. Thanks.
Okay so I think this is not a bug. This is a valid statement alone:
if i! = 0 then rem this will not compile
This is a completed IF ... THEN
construct because there is a statement after THEN
in the same line. Which means there must not be any ENDIF
after this line. IF ... THEN
has two forms:
IF <condition> THEN <statements>
(in a single line)IF <condition> THEN <newline> <statements> ENDIF
(multiline)May I ask what version you are using? Just type
xcbasic64 -h
and it will print version. Thanks.
A little too late, I see, but for the sake of completeness, version 2.3.02
Okay so I think this is not a bug. This is a valid statement alone:
if i! = 0 then rem this will not compile
This is a completedIF ... THEN
construct because there is a statement afterTHEN
in the same line. Which means there must not be anyENDIF
after this line.IF ... THEN
has two forms:1. One is `IF <condition> THEN <statements>` (in a single line) 2. Another is `IF <condition> THEN <newline> <statements> ENDIF` (multiline)
I see your point. However, this then invalidates the multiline construct. This seems to bring an inconsistency to the language. It is easily worked around though.
I am enjoying getting to know xcbasic. Keep up the good work!
Thanks! I think it's clear syntax because it's either single-line or multiline, it can't be both. However, it may be confusing that REM
is not just a comment that's totally ignored by the parser, but it's a valid statement (that does nothing actually).
This will not compile and produces the message "ERROR: ENDIF without IF...":
This will be compiled: