Repository navigation
BASIC-256 v2.3.1 is out. It builds on 2.3.0 with a toolkit for drawing a window-style interface, a way to grow an array one row at a time, an IDE that goes dark with the rest of the system, and safer saving.
One change breaks programs: the functions in the bundled modules have been renamed. A program that includes math.kbs or turtle.kbs needs its calls renamed — see the list at the end.
What 2.3.1 brings
- A toolkit for window-style programs, as a bundled module.
INCLUDE "toolkit.kbs"draws push buttons, checkboxes, radio buttons, sliders, spin boxes, tabs, group boxes, grids of drawing fields and editable text fields on the graphics output. Each element has a subroutine that draws it, such astk_button, and a function that tells whether a mouse click landed on it, such astk_buttonhit. The program keeps track of each element's state and redraws the element when that changes.call tk_help()lists everything in the module, and the programs inExamples/GUI-Demoshow each element at work. - Arrays that grow, with the new
ARRAYADDstatement.arrayadd names, "Bob"adds a value to the end of a one-dimensional array, andarrayadd points, x, yadds a row to a two-dimensional one. An array can be given instead of separate values, and a variable with nothing in it yet becomes an array, so a table can be built up in a loop without aDIM. - A dark IDE that follows the system. View ▸ Theme ▸ Follow System now turns the whole IDE dark when the operating system is in dark mode: menus, toolbars, docks and dialogs as well as the Edit, Text Output and Variable Watch windows. On Windows 10, BASIC-256 switches to the Fusion style while Windows is dark. The Variable Watch window now follows the theme you pick, as the other windows already did.
- Safer saving. Save As opens in the folder the program was loaded from, with its name already filled in. The bundled examples are never overwritten: Save on an example asks for a new name, and the Examples folder can't be chosen as a place to save. A new preference, Warn when overwriting an existing file, is on by default; untick it and Save writes straight back to the program's own file without asking.
- Mouse clicks work in a scaled or zoomed window.
CLICKX,CLICKYand double-clicks now report the graphics pixel under the pointer whenGRAPHSIZEhas scaled the window up or the View menu has zoomed it, the wayMOUSEXandMOUSEYalready did. A negative scale shows the whole picture turned round.
Also in this release
- A whole number too big for 64 bits, such as
9223372036854775808, is now reported as "Number too large" when the program is compiled. - New example programs: a series of Falling Sand programs that builds up the final program a step at a time,
Examples/Fun/balgame256.kbs(a ball-bouncing game played with the mouse, ported from a TIC-80 game by Uras SARI) andExamples/Fun/FallingLetters.kbs(a rain of green letters). Both games also run in the browser version. - The Raspberry Pi archive now includes the TestSuite and the benchmark. The AppImages still leave them out, because an AppImage is read-only and both write scratch files into their own folder.
- The Windows installer and uninstaller notice when BASIC-256 is still running from the folder they are working on and ask for it to be closed, with Retry and Cancel, instead of stopping with an error about
basic256.exe.
Things to watch when upgrading
- Every function and subroutine in the bundled modules now starts with its module's prefix:
ma_formath.kbs,tu_forturtle.kbsandtk_fortoolkit.kbs. A program written for 2.3.0 that still calls the old names stops with an error, sosumarr,hypot,clamp,lerpandrandintbecomema_sumarr,ma_hypot,ma_clamp,ma_lerpandma_randint, andt_forwardbecomestu_forward. Two names change by more than the prefix:remapis nowma_map, andfroundhas been removed. Each module has a help routine (call ma_help(),call tu_help(),call tk_help()) that lists what is in it. arrayaddis now a reserved word, so a program that used it as a variable or function name has to rename it.- The Automatically save program when it is successfully run preference has been removed.
See the changelog for the full list.