IF LEN(string$)>255 THEN don’t be left stranded
Last month, Steve Drain announced the release of version 1.50 beta of Basalt, his module that provides extra features to BBC BASIC V. This version provides support for long strings, which Steve refers to as ‘strands’. There is also a comprehensive StrongHelp manual, but as yet there isn’t an online HTML version available.
Briefly explaining strands, Steve says:
A strand is a normal BASIC string that holds a reference to a long string. A strand variable is assigned with LET and can be released with DELETE. Strands can be concatenated with other strands and normal strings (literals, variables and functions) to make strand expressions.
Strands (variables and expressions) only have meaning if keywords recognise them and this is done by enclosing strand parameters in parentheses, (). It is never otherwise necessary to enclose a parameter in parentheses, although it has always been optional. I would welcome comments on this choice of syntax.
There are alternative versions of nearly all the necessary BASIC keywords to work with strands, but the normal operation of BASIC is not changed. The string functions return a strand value if they have a strand parameter:
PRINT STRING$ SUM$(SUM) LEFT$ MID$ RIGHT$ INSTR LEN SUMLEN ASC BPUT BGET$(GET$)
All Basalt string keywords also work with strands:
SWAP$ MOD$ SEARCH$ MATCH$ REPLACE$ COUNT FIELDS FIELDS$ ARG$ SAVE LOAD$ PTR PTY TWIN RETURN$
Steve has also released new version of HongKong, a version of the Mahjong patience game Shanghai, written as a demonstration of Basalt and its Toolbox keywords. The game uses a drag and drop interface for play, and also differs in some other ways from alternative versions.
Releasing version 1.50, Steve explained that “This version is primarily an update to be compatible with the current versions of Basalt, but there are some minor improvements to the way tiles are dragged” and added a warning that “The other example applications [on the same page] have not yet been updated and will not work with the current versions of Basalt.”
Since then, he has also released version 1.60, which adds a choice of tile sets, and 1.67 which addresses some serious problems with newer versions of RISC OS.