Releases: boxgaming/qbjs
Release list
Release 0.11.3
This is a maintenance release containing the following fixes and updates:
- Fix for #224 - No input possible after using fullscreen button
- GX - Fixed map tile positioning for negative screen coordinates.
- GX - Added missing GXMapTilePosAt method mapping.
- GX - Fix for GXMapTilePosAt logic which was incorrectly factoring in the scene position.
Release 0.11.2
This is a maintenance release containing the following fixes and updates:
- Added support for _ControlChr (#223)
- Added AssertError method to Unit Testing library
- Fixes to clamp rgb(a) values when constructing color objects. Changed conversion to/from numeric representation from hex string parsing to shift operations for performance
- Fix for #216 - VFS - getNode() crashes on a leading ".."
- Fix for #218 - getNode("docs/") (trailing slash) returns null
- Fix for #215 - LTRIM$/RTRIM$/_TRIM$ strip all whitespace
- Fix for #212 - PRINT USING numeric overflow prints the mask
- Fix for static variable naming when function name has type suffixes
- Added tests for number literal suffix fix
- Fix for #222 - Numeric literal type-suffixes → invalid JS
- Fix for #207 - VAL returns 0 for a number followed by text
- Fix for #214 - _R2G (radians→gradians) formula wrong
- Fix for #211 - INPUT # crashes on a blank line
- Fix for #210 - LINE INPUT # leaves a trailing carriage return
- Fix for #204 - PRINT (file statement) of a numeric value writes nothing
- Fix for #205 - CDBL / CSNG return a string, corrupting arithmetic
- Fix for #123 - LOCATE with an omitted row/col resets it to 1
- Fix for (#203) - FOR … STEP s with a runtime-negative step runs 0
- Fix for (#221) - Missing incude causes compilation error
- Miscellaneous gx.js fixes (#219,#220)
- Fix for _Round method to use banker's rounding (#208)
- Added warning/error for unsupported EQV and IMP operators
- Updated qb-console.js to use same number assertion method as qb.js
- Added missing Abs method in qb-console needed to support command-line compilation.
Release 0.11.1
This is a maintenance release containing the following fixes and updates:
- Added vfs dependencies to fix console-only compilation
Release 0.11.0
Try out the release online here: https://qbjs.org
Release Highlights
New Language Features
Import
This release includes a major update to Import functionality. The Import keyword provides the ability to include library modules from external source files. Prior to this release, Import statements could only be used in the main program. With this release that restriction has been removed and Import statements can appear in nested imported modules. The same library can now be imported multiple times. Support for relative import paths has also been included as part of the update.
Standard Library Additions
This release contains a significant number of additions to the standard QBJS extension libraries. Three new libraries: Array Utilities, Object Utilities, and the System Library, have been added to provide greater access to lower-level Javascript functionality using QBasic syntax. The Dom library has been greatly expanded to provide more event handling and process control.
| Library | Description | Methods Added |
|---|---|---|
FileSystemlib/io/fs.bas |
Extended functionality for input/output related to the virtual filesystem. | GetFilename, GetParentPath, ReadText, WriteText |
Array Utilities NEWlib/lang/array.bas |
Provides extended functionality for interacting with native JavaScript arrays. | Add, At, Clear, Concat, Create, Every, Fill, Filter, IndexOf, Insert, Item, IsJSArray, IsQBArray, Join, LastIndexOf, Length, Pop, Push, Reduce, ReduceRight, Remove, Reverse, Shift, Slice, Sort, Splice, Unshift, ToQBArray |
Object Utilities NEWlib/lang/object.bas |
Provides extended functionality for interacting with JavaScript objects. | Assign, GetProperty, HasProperty, Keys, SetProperty, RemoveProperty |
String Utilitieslib/lang/string.bas |
Provides extended common string utility methods. | FormatUsing |
System Library NEWlib/lang/system.bas |
Provides low-level system access. | Await, Call, Construct, IsRunning, SetTimeout, TypeOf, TimeInMillis, ToFloat, ToInteger, ToBoolean, ToString |
Unit Testing NEWlib/test/unit-test.bas |
Provides methods for creating unit tests. | AssertEquals, AssertTrue, AssertFalse |
Dom lib/web/dom.bas |
Provides access to the current web page's document object model. | DialogClose, DialogShow, DialogShowModal, Document, GetAttribute, GetAttributeNames, GetElementsByClassName, HasFocus, Focus, RequestAnimationFrame, RequestFullscreen, SelectAll, SetAttribute, StopPropagation, Window |
Unit Test Framework
A new Unit Test library provides basic functionality to create unit tests using the simple assertion methods. A suite of unit tests has been developed using this library to regression test QBJS itself. The tests can be found in the project test directory. With each subsequent release more tests will be added to this suite to expand the test coverage.
Language/Compatibility Enhancements
This release contains a number of important language support updates to further enhance the compatibility of QBJS with QBasic and QB64.
- Programs can now utilize the $Include metacommand to include source code from additional source files.
- INPUT keyword will now utilize the virtual keyboard on mobile devices.
- Outstanding Select Case features have now been implemented:
- SELECT CASE [lowerValue] TO [upperValue]
- SELECT EVERYCASE
- EXIT SELECT
- EXIT CASE
- Support for PRINT USING
- Additional miscellaneous keywords including:
- COMMON, MKS$, MKD$, CVS, CVD
QB64PE Compatibility
For the first time, this release includes support for QB64PE-specific functionality. For some context, the QBJS project began during the period in which there was a single QB64 fork maintained by the QB64 Team. Since that time the QB64 Team was dissolved and new, separate forks were created to carry on QB64 maintenance and development. The goals of QBJS are to maintain compatibility with this core, QB64 functionality which is common between each of the descendants of the original QB64 project. Of the current forks, the QB64 Phoenix Edition has emerged as the only known fork with ongoing, active development. While full compatibility with descendent forks is not a stated goal of the QBJS project, for certain compelling use cases, keywords compatible with Phoenix Edition may be added.
This release now supports the following features which are present in the QB64PE fork:
- Boolean operators _AndAlso, _OrElse, and _Negate
- Support for the $IncludeOnce metacommand
- The parser has also been updated to allow main module code between and after SUB and FUNCTION definitions.
Finally, a number of additional QB64PE-specific keywords can be supported via an optional include file. To enable this support, add the following line to the top of your program:
'$Include: 'lib/compatibility/qb64pe.bi'
Once included, the following additional methods will be available:
- _BASE64ENCODE$, _BASE64DECODE$, _CLAMP, _ColorChooserDialog, _DECODEURL$, _ENCODEURL$,
_FULLPATH$, _IIF, _INPUTBOX$, _LOGERROR, _LOGINFO, _LOGMINLEVEL, _LOGTRACE, _LOGWARN,
_MAX, _MESSAGEBOX (statement), _MESSAGEBOX (function), _MIN, _MOUSEHIDDEN,
_NOTIFYPOPUP, _READFILE$, _SAVEIMAGE, _TOSTR$, _WRITEFILE
Including this file will also make available additional QB64PE-specific constants.
Numerous other compatibility enhancements and fixes can be found in the full release notes below.
Release Notes
Language/Compatibility Updates
- Added support for $Include directive (#64)
- SELECT CASE enhancements
- Added support for PRINT USING (#107).
- Added support for COMMON (#198)
- Added support for remaining MKn$, CVn functions (#72)
- Fix for #179 - Arithmetic expressions in a dim statement with arrays are not evaluated correctly
- Round floating-point values when assigned to integer type variables (#186)
- Updated all methods returning color values to return numeric version rather than hidden object representation (#190)
- Enable virtual keyboard for INPUT on mobile (#66)
- QB64PE
- Added support for boolean operators: AndAlso, OrElse and Negate (#187)
- Updated parser to allow main module code to appear between and after sub and function definitions (#194)
- Added support for $IncludeOnce directive (#196)
- Added include file to enable QB64PE-specific keywords:
_BASE64ENCODE$, _BASE64DECODE$, _CLAMP, _ColorChooserDialog, _DECODEURL$, _ENCODEURL$, _FULLPATH$, _IIF, _INPUTBOX$, _LOGERROR, _LOGINFO, _LOGMINLEVEL, _LOGTRACE, _LOGWARN, _MAX, _MESSAGEBOX (statement), _MESSAGEBOX (function), _MIN, _MOUSEHIDDEN, _NOTIFYPOPUP, _READFILE$, _SAVEIMAGE, _TOSTR$, _UFONTHEIGHT, _UPRINTWIDTH, _WRITEFILE
New Language Features
- Major updates to Import functionality to allow nested imports and relative import paths (#193)
- Additions to existing standard libraries
- Dom Library
- Add event and process control methods to Dom extension library (#185)
- Added accessor methods for window and document objects
- Added Attribute access methods.
- Added GetElementsByClassName.
- String Library
- Added explicit string conversion to all applicable methods
- Added FormatUsing, a new utility function to the which uses the same formatting logic as "PRINT USING".
- FS Library
- Added new utility methods ReadText, WriteText, GetFilename, GetParentPath
- Dom Library
- New standard libraries
- Array Library
- Added standard library for interacting with native javascript arrays (#183)
- System Library
- Added system library to allow invocation of any javascript method as well as low-level utility methods
- Added ability to create a new native Javascript object.
- Object Library
- Added new low-level library for working with objects. Updated compiler to be able to use imported libraries.
- Array Library
- Added new unit test framework
IDE Updates
- Fixed issue preventing focus from being correctly set back to the editor when selecting a method from the methods (f2) dialog.
- IDE - Updated to escape html written to console as part of an error message
- Added link in About dialog to wiki page with open source attributions and licenses. (#135)
General Fixes
- Added missing FreeFile keyword implementation
- Fixed typo in Tan method
- Updated Hex$ and Oct$ methods to round any decimal input values
- Fix to Val method to support lowercase numeric base prefixes: "&h", "&o", "&b"
- Added logic to reduce chance of mis-identifying equals condition as variable assignment
- Fixed bug with RmDir method
- Fixed JS reserved words as method parameter issue (#199)
- Fixed CSng and CDbl functions (#200)
- IncludeJS will now wait for the Javascript to l...
Release 0.10.5
Release 0.10.4
This is a maintenance release containing the following fixes:
General
- Fix for SndVol to use 0 to 1 for volume range
Compiler
- Command-line compiler fixes for Import statement
- Inclusion of export dependencies file to support command-line builds
Release 0.10.3
This is a maintenance release containing the following fixes:
General
- Updates to support fonts 8 and 14 for associated screen modes (#177).
- Updated to return character sizing for _Width and _Height in mode 0 images (#181)
- Fixes to Screen method to support (#181)
- Fix to alpha component of color object created in Point method (#180)
- Updated to detect color object and convert to number for numeric parameters of built-in methods (e.g. Hex$(Point(1, 1))
- Fix to browser storage library caused by recent compiler improvements
- Fixed typo in RotoZoom preventing correct usage of _Dest other than 0
- Fix for audio context close error (#176)
- Update to set focus to canvas when clicked (#175)
IDE / Compiler
- Add error checking for Import statement (#178)
- Updated to correctly dispatch a window resize event when the sizing sliders are moved.
- Updated to hide the active tab (instead of only the main code window) when the code panel is minimized.
- Fix to IDE "play" mode
GX
- Added missing GXSceneWindowSize method which will resize the scene to the specified height and width without changing the current scaling
Release 0.10.2
This is a maintenance release containing the following fixes:
- Added missing _FreeFont method (#167)
- Added getSound accessor method for extension libraries
- Fix for array variable declaration issue (170#)
- Fixes for global method variable declaration (163#)
- Fixed console error message wrong module issue (#162)
- Fixes to correctly handle reserved JS word "in"
- IDE Fix to ensure that all code editor tabs use current key binding mode
GX
- Framerate fix for higher frequency displays. This change also now allows setting framerate lower than the default (60).
- Updated GXFrameRate function to return calculated, actual FPS
- Entity animation speed fix
- Entity gravity fix for frame rates other than 60 fps
- Added support for "top down" mode entity rendering (GX)
Release 0.10.1
This is a maintenance release containing the following fixes:
- Fix to MId$ statement when arrays are passed as arguments
- Added error handling to prevent errors writing to screen text buffer past bounds
- Attempting to use the SndVol method results in the following error: “GX.soundVolunme is not a function” (#166)
- Syntax Highlighting Fixes for "Static" keyword and GX methods: GXEntityMapLayer, GXEntityFrame, GXEntityFrames, GXEntitySequence, GXEntitySequences (#164, #165)
- Added missing mapping for the GXEntityFrame function (#165)
Full Changelog: v0.10.0-beta...v0.10.1-beta
Release 0.10.0
Try out the release online here: https://qbjs.org
Release Highlights
Language/Compatibility Enhancements
This release contains a number of important language support updates which should greatly enhance the compatibility of QBJS with QBasic/QB64.
Implicit Variable Declaration
One of the most significant updates included in this release is support for implicit variable declaration. It is no longer necessary to make sure that you DIM all of your variables in QBJS. This enhancement also includes support for the QB64 Option _Explicit and Option _ExplicitArray directives.
Integer Division Operator
This release also now includes full support for the integer division (\) operator. In previous releases integer division was treated identically to a normal division operator (/) and did not perform the expected rounding.
More Keywords
Support has been added for QBasic Mid$ statement as well as the QB64 Clipboard methods:
- _Clipboard (statement)
- _Clipboard (function)
- _ClipboardImage (statement)
- _ClipboardImage (function)
Numerous other compatibility enhancements and fixes can be found in the full release notes below.
New Language Features
This release adds support for Method Pointers which provide the ability to define Functions and Subs as variable types. Pointers to existing subs or functions can be referenced with the new '@' operator. Also included is a new standard String library containing commonly used string operations (e.g. Replace, Split) as well as advanced regular expression matching.
IDE Updates
The QBJS IDE has also received a major refresh with this update. A "New Project" button has been added to the toolbar to allow convenient creation of a new, blank project when one is already open.
Code tabs have been added to make it easier to manage larger projects with multiple resources in the QBJS IDE. Users can now open additional files from the virtual file system for edit in separate code tabs. This includes syntax highlighting for a number of known text file formats:

All other text files will be loaded in a plain text editor as shown below:

Image formats will be loaded in an image preview tab:

Sound file formats will be loaded in an audio preview tab:

All other binary files will be loaded in a hex viewer tab.
New Theme
A new theme named Blackout has been added for those who like a very dark look but retains the same font and feel as the original QBasic IDE.

Javascript Tab Syntax Highlighting
Syntax highlighting has been enabled for the Javascript tab in the console to aid in readability of the generated Javascript for troubleshooting:

Release Notes
Language/Compatiblility Updates
- Support for implicit variable declaration (#57, #33, #151)
- Support for Option _Explicit and Option _ExplicitArray
- Fixes for method-level SHARED variable declarations.
- Variables declared in the main module are effectively "Shared" whether they are defined as such or not. (#158)
- Added support for method-level CONSTs
- Full support for integer divison (\) operator (#147)
- Implement Mid$ statement
- Implement QB64 Clipboard functions (#76)
- Implements _Clipboard$ (statement and function)
- Implements _ClipboardImage (statement and function)
- Update InKey$ to fill key press buffer when key is held down (#65)
- Fixed InKey mapping for space and escape.
- PRINT - Trailing space not being printed for numeric variables (#84)
- Fixed error loading standard web fonts (#152)
- Removed compiler warning for $NoPrefix since keyword prefixes are optional
- Fix erroneous block end error messages when used in combination with "$If Javascript"
- Add compiler error for unterminated string constants
- Allow "ENDIF" as well as "END IF"
- Allow "$ENDIF" as well as "$END IF"
- Allow "?" to be used as shorthand for PRINT
New Language Features
- Added support for Function and Sub as variable types (#156)
- Added support for method reference prefix "@" and Function and Sub as types
- Add extended standard library for common String operations (#157)
IDE Updates
- Added 'New' button to IDE
- Added code tabs to enable editing/preview of files in VFS (#132)
- Added syntax highlighting to Javascript tab (#145, #148)
- Added new "Blackout" theme
- Set focus to editor when clicking an error or warning in console (#142)
- Updated methods dialog in IDE to distinguish array parameters in method descriptions
- Added module info to error/warning data to support showing errors in appropriate source file
- Updates to disable code editor(s) while program is executing
- Stops previous program at load
- Stops program before creating new project
- Added console settings persistence IDE
GX Fixes and Updates
- Added missing GX methods: GXEntitySequence, GXEntitySequences
- Collision detection fixes
- Fixes to GXMapLoad for legacy web map format