BASIC-256 v2.3.0 is out. 2.2.0 started adding to the language; 2.3.0 carries on with a sort built in, a proper character screen for text, colour by hue and a few long-standing loose ends tied up. It also changes how a program reaches outside its own folder, which is why it is 2.3 rather than 2.2.1.
Most programs keep working unchanged, but this release has more to watch for when upgrading than the last one did, so read the list at the end before moving a classroom over.
What 2.3.0 brings
- A program asks before it touches files outside its own folder. Anything at or below the folder a program was loaded from is read and written without a word. Naming anything outside it — with
OPEN,KILL,MKDIR,IMGSAVE,DBOPEN, a path inside SQL or any other statement — brings up a dialog offering Don't allow, Allow once and Allow for this run. A file picked in a file dialog never asks, and Preferences ▸ Advanced has a standing answer for anyone who wants it. The browser version is unchanged. - The Text Output window can be a screen as well as a scroll.
LOCATE column, rowputs the cursor anywhere, and what is printed there replaces the characters it lands on, so a score, a clock or a counter can be rewritten in place.TEXTCOLOR,TEXTBACKGROUNDandTEXTFONTcolour and style it, andTEXTCOLandTEXTROWread the position back. - A real character screen, with the new
TEXTSCREENstatement.TEXTSCREEN 40, 25turns the window into a fixed grid of characters, the kind the home computers of the eighties printed on, so boxes close up and columns line up whatever the font. A third argument asks for square cells, andTEXTCHAR(column, row)reads a character back off the screen. - Arrays can be sorted, with the new
SORTstatement.sort namesputs a list in order, andascending,descendingandignorecasemay follow it in any order. A two-dimensional array has its rows sorted on the column given —sort scores, 1, descending— each row moving as a whole. The sort is stable. - Colour by hue, with the new
HSVfunction.hsv(hue, saturation, value)is the sibling ofRGB: the hue in degrees round the colour wheel and the other two in percent, with an optional alpha. NOISEtakes a third coordinate.noise(x, y, z)lets a program draw with x and y and move through z as time — clouds, water or fire that change smoothly instead of standing still.- Text on sprites, with
SPRITETEXT.spritetext n, text$makes a sprite from the text in the current font and colour, and a third argument fills it with a background colour first. - A benchmark you can run yourself.
TestSuite/Benchmarktimes each part of the language and prints one table at the end, so you can measure the speed on your own machine, or compare two machines or two versions.
Also in this release
SPRITEWandSPRITEHnow report the size a sprite covers on the screen, following the scale and rotation it was given.IMGLOAD,GETSLICEandPUTSLICEnow understandWINDOWcoordinates, the wayPLOTandPIXELdo.- A statement with no arguments followed straight away by a colon —
next: print i,cls: print "ready"— is now that statement, instead of being read as a label and skipped. DBOPENnow works in the Raspberry Pi downloads, which were missing the SQLite driver, and the Pi archive now includes the TestSuite and the benchmark like the other platforms.- New example programs ship with the release, among them
Examples/DataBase/GamesDB.kbs, a small games database with a menu drawn on aTEXTSCREEN. - Release downloads are now published by the build itself: every platform, and the browser version as
BASIC256-WASM.zip, arrives as a bare file rather than wrapped in an extra zip.
Things to watch when upgrading
- A program that reads or writes outside its own folder will now ask first, and a program started with
--silentis refused rather than asked. NETLISTENnow listens only on the machine it is running on. For two machines talking to each other, tick NETLISTEN accepts connections from other machines in Preferences ▸ Advanced.MKDIRworks again withoutSYSTEMbeing switched on, butRMDIRhas been removed for good.- A parameter declared with
ref()now receives the caller's own variable, as the documentation has always said, socall fill(a)changesa. sort,ascending,descending,ignorecaseandhsvare now reserved words, so a program that used one of them as a variable or function name has to rename it.
See the changelog for the full list.