Releases: maurymarkowitz/RetroBASIC
RetroBASIC v1.8.6
Added support for the INSTR function found in most later versions of BASIC.
It supports both orderings of the parameters in the optional three-operand format, with the starting position in the first or last parameter.
It also supports the most common alternative function names, INDEX and POS. In the latter case, POS with a single parameter calls the existing function that returns the cursor position.
RetroBASIC v1.8.6
Fixed a problem in array initialization that caused amazing.bas to periodically fail on small mazes.
RetroBASIC v1.8.5
Minor bug fix - array indexes were not being floor()ed so this led to out-of-bounds when using fractional values. This was seen in Super Star Trek when entering directions >8.
RetroBASIC v1.8.4
The major change in this release was to merge the formerly separate GOSUB and FOR/NEXT stacks into a single stack. This means that RETURNing from inside a loop will properly clean up the stack and remove any NEXT items the sub added.
In addition, the POP and EXIT commands have been added to work with the stack.
POP simply removes the last entry on the stack, which can cause it to become corrupted and is generally only used in limited circumstances.
EXIT is somewhat smarter. If the last entry on the stack is a GOSUB then it it works exactly like a RETURN. But in a FOR/NEXT, it stops the loop, removes the NEXT entry, and then moves to the statement after the NEXT. This allows for clean early exits from loops.
Additionally, array indexes are floor()ed, avoiding an issue in Super Star Trek when entering fractional courses >8.
RetroBASIC v1.8.3
Added the LABEL statement, which is followed by any valid (and preferably unique) variable name. At parse time, any LABELs found in the BASIC source will cache their line number. As RetroBASIC allows any expression to be used as a branch target, one can then simply GOTO that label. The line number value is stored as a normal numeric variable, which means that you can PRINT it out, or change if it desired using a normal math assignment statement or LET. To use it in a typical program, one might:
490 RM=10
500 GOSUB RN
510 PRINT"The random number from one to ten is: ";R
...
5000 LABEL RN
5010 R=INT(RND(0)*RM+0.5)
5020 RETURN
Note that, like all branches, execution always starts at the first statement on the target line. That means if you put a LABEL as, say, the third statement on that line, the first two statements will still be executed, it does not attempt to move past the LABEL.
Also fixed an obscure issue in amazing.bas, which caused 2x2 mazes to fail, but nothing larger.
RetroBASIC v1.8.2
Added PAUSE statement. With no parameters, it waits for a keypress, as in Benton Harbor BASIC and similar. If a parameter is given, it is a number of jiffies to pause, 1/60ths of a second.
Added UBOUND and LBOUND for returning the dimensions of arrays.
Added support for hex, oct and binary constants. Hex can be entered as &A3CE, 0xA3CE or 0hA3CE. Oct and bin are 0o and 0b respectively.
RetroBASIC v1.8.1
Added amazing.bas to the test programs and a scheme in Xcode to use it.
Changed the way arrays are set up so they can use runtime variables. Previously the memory was set up at parse time, not runtime, so variables in the DIM would be zero and the array would default to 10 entries. Now the dimensions are calculated at runtime instead, so you can, as is the case in amazing, use variables and INPUT to set the dimensions.
RetroBASIC v.1.8.0
Added array-slicing for string assignments - LET A$(4:5)="B"
Refactored some of the code to support that, added slice_limits and variable_storage funcs
Renamed variable_t to variable_reference_t for clarity
Added HEX, OCT, BIN, HEX$, OCT$, BIN$
Fixed bug in STRING$ when passing ASCII numbers
String slicing assignment needs further work as it varies among implementations and needs to try to track these better.
RetroBASIC v.1.7.2
Added new statistic to output the average number of digits in a line number. For instance, SST = 3.86, strongly suggesting the use of 16-bit ints instead of ASCII
RetroBASIC v1.7.1
Fixed missing import in list.h, allowing it to compile properly on Linux.
Better handling of optional parameters on command line switches like -r.
Better seeding of the random numbers, so quick startups won't give the same sequence.