EndBASIC 0.10.0
Released on 2022-12-27.
This is a huge release that focuses on extending the capabilities of the core
language so that non-trivial programs can be written in it.
Language changes for better control flow:
-
Issue #153: Added support for labels (identifiers prefixed by an
@sign)
andGOTO. -
Issue #155: Added support for "line numbers as labels", just like
QuickBASIC does, which permits running the traditional10 GOTO 10
program. Note, however, that these line numbers have nothing to do with
the actual line numbers in the file. To minimize confusion, line numbers
have been removed from the output ofLIST. -
Added support for
GOSUBandRETURN, which provides a rudimentary
mechanism to reuse code within a program. -
Issue #121: Added support for catching errors via
ON ERROR GOTOandON ERROR RESUME NEXT. Captured error messages are exposed to the user via
a newERRMSGfunction. -
Replaced the
EXITcommand with theENDkeyword. -
Added support for
DOloops with optionalUNTIL/WHILEpre- and
post-guards andEXIT DOearly terminations. -
Added support for uniline
IFstatements. -
Added support for
SELECT CASE. -
Fixed
ENDso that it works in the context ofWHILEloops and so that
no further expressions are evaluated inFORand `IF statements. -
Rewrote the execution interpreter to be bytecode based instead of walking
over the AST.
Language changes for better numeric handling:
-
Issue #114: Added transparent promotion from integers to doubles and
automatic rounding of doubles as integers. -
Issue #114: Added support for doubles in
FORiteration, both to specify
the loop range and the step. -
Added support for the exponent (
^) operator and theSQRfunction. -
Added syntax to specify integers in different bases, using forms like
&b_1010,&d_1234,&o_750, and&x_12f. -
Extended
AND,NOT,OR, andXORto perform bitwise operations when
operating on an integer context and added the<<and>>bit shift
operators.
Standard library changes:
-
Issue #114: Removed the
DTOIandITODfunctions now that integers and
doubles are automatically converted between them, and added theCINTand
INTfunctions. -
Issue #114: Removed the
MAXD/MAXIandMIND/MINIduality in favor of
simplerMAXandMINfunctions that can mix and match integers and
doubles. -
Changed the syntax of the
MOUNTcommand to take advantage of theAS
keyword as an argument separator and thus be of the form
MOUNT target$ AS $drive_name$. -
Fixed
PRINTso that, if the statement ends in a comma or in a semicolon,
no newline character is printed. Useful to construct output lines in
multiple steps and matches the behavior of other BASIC implementations. -
Issue #154: Added support for the
DATAstatement and theREADand
RESTOREcommands. Booleans, numbers, and strings are supported, but
strings must be double-quoted (as opposed to other BASIC implementations
where the double-quoting is optional). -
Added the
ASC,CHR, andSTRfunctions. -
Renamed
DELasKILLto match QuickBASIC and avoid confusion with a
potential futureDELETEcommand implementation. -
Fixed
INPUTso that the prompt is optional and thus things like
INPUT varwork as they do in traditional BASIC implementations. -
Issue #108: Added the
SCRROWSandSCRCOLSfunctions to query the size
of the textual console and theGFX_HEIGHTandGFX_WIDTHto query the
size of the graphical console. -
Added the
GFX_CIRCLEandGFX_CIRCLEFcommands to draw circles.
Usability improvements and fixes:
-
Issue #113: Added line and column tracking to error messages for parsing
and execution errors. Also cleaned up RustDebugimpls that leaked
into strings to provide nicer error messages. -
Issue #111: Added support to interrupt running programs via
CTRL+C. -
Extended the builtin language documentation to explain in detail every
statement type.HELP "LANG"now displays a collection of topics to
choose from, instead of a one-page cheat sheet. -
Added the
PALETTE.BASdemo, which is a little tool that renders the
full color palette. -
Changed the syntax to call argument-less functions, such as
INKEYand
PI, so that they do not accept(). This matches traditional BASIC
implementations. -
Fixed erratic insertion of newlines in existing text in the editor.
-
Modified the
HELPcommand to only accept a string as its argument
instead of also recognizing a bare word. The latter was only approximate
and would cause confusion when typing something likeHELP DATA, as this
resulted in a parse error. -
Rewrote the SDL console internals to use a separate thread that implements
the SDL main loop. This fixes some rendering issues and crashes that have
been previously observed with this implementation. -
Modified the interpreter to parse the full program before executing it,
which was a requirement for supportingGOTOs and features likeDATA.
As a side-effect of this change, any syntax errors now cause the
interpreted program to not run at all, as opposed to before when the
program would make progress until it hit the error.