Skip to content

BASIC256 2.3.2

Latest

Choose a tag to compare

@uglymike17 uglymike17 released this 22 Nov 17:54

BASIC-256 v2.3.2 is out. It speaks more languages, now including Hindi, draws much faster without FASTGRAPHICS, and fixes a set of problems found while writing the programs for the book A Guide to BASIC256.
Nothing in this release renames or removes a statement, but a few results change — see the list at the end.

What 2.3.2 brings

  • BASIC-256 in Hindi. Start it with basic256 -l hi, or simply on a computer set to Hindi, and the whole IDE is in Hindi: menus, toolbars, the Text Output, Graphics Output and Variable Watch windows, Find/Replace, Preferences, the About box, the questions asked before a program may use SYSTEM, PORTIN/PORTOUT or a file outside its folder, and every compile and run-time error message. Menu items keep their English underlined letter, shown in brackets after the Hindi text, so the Alt shortcuts are the same as in English.
  • Translations completed in seven languages. The menus, the Preferences window, the persistent settings browser and the About box are now fully translated in Dutch, French, German, Italian, Portuguese, Russian and Spanish, including newer items such as Save All, the Zoom submenu, Theme and Wrap Long Lines. Within each menu every item has its own underlined letter, so the Alt shortcuts no longer clash. Choose a language with -l and its code: de, en, es, fr, hi, it, nl, pt or ru.
  • Much faster drawing without FASTGRAPHICS. The graphics window is now brought up to date at most once every 16 milliseconds, about once a screen frame, instead of after every statement, so 5000 RECT statements take about as long as they do with FASTGRAPHICS. A lone drawing still shows at once, and the window is always up to date when the program ends, PAUSEs, waits at FRAMERATE, INPUT or a dialog, plays a blocking sound or stops at a debugger step. REFRESH still updates the window straight away. The graphics window is also kept in the format the screen uses, so it takes less work to show.

Fixes found while writing A Guide to BASIC256

  • DBINT, DBFLOAT, DBSTRING and DBNULL on a record set that was never opened give error 34, "Record set must be opened first", and READBYTE on a file number that is not open gives error 7, "File not open". Both used to close BASIC-256.
  • ASSIGNED and IN answer a map key that does not exist with false, so a program can ask whether a key is there before reading it: if "pizza" in tally then ... no longer stops with "Map key has not been assigned a value". Reading a missing key still does.
  • += on an element of a string array adds the text to the end, as it does on a plain variable: after a$[0] = "x" : a$[0] += "y", a$[0] is "xy", not "yx".
  • ISNUMERIC is true only for a number, or a string written as one.
  • SOUNDWAVEFORM keeps the fractions in its array, so amplitudes such as 0.5 and fractional durations shape the wave as given. SOUNDHARMONICS given a two-column array, one harmonic and its amplitude on each row, uses every row instead of every second one. A SOUNDWAVEFORM array of exactly SOUNDSAMPLERATE values plays at full volume instead of almost silently.
  • The toolkit.kbs module draws its captions in Tahoma on Windows and in BASIC-256's default font elsewhere, including the browser, at normal weight. The new function tk_fontname$() returns the font it uses, so a program can match it with font tk_fontname$(), 9, 400. Checkboxes and radio buttons clear behind their label before drawing it, so a label no longer gets bolder each time the control is redrawn. The toolkit examples use the new function too.

Also in this release

  • Returning from a function or subroutine frees its variables correctly. It used to release them the wrong way, which could corrupt memory.

Things to watch when upgrading

  • ISNUMERIC is stricter. Strings with another character where a decimal point could go, such as "1,5", "1,500" or "1x5", are no longer counted as numbers, and INT and FLOAT turn them into 0.
  • A program that already gave SOUNDWAVEFORM fractional values will sound different, because they used to be cut to whole numbers.
  • GETPIXEL and GETSLICE can read a partly transparent colour back very slightly different from the one drawn. Solid colours read back exactly.

See the changelog for the full list.