-
Notifications
You must be signed in to change notification settings - Fork 12
Supported Keywords
The following table lists the QBasic and QB64 keywords that are currently supported by QBJS. If not listed here then the assumption can be made that the keyword is not supported. This page will be updated as additional keyword support is added.
| Keyword | Support | Notes |
|---|---|---|
| Abs | Full | |
| Asc | Full | |
| Atn | Full | |
| Beep | Full | |
| Call | Full | |
| ChDir | Full | |
| CDbl | Full | |
| Chr$ | Full | |
| CInt | Full | |
| Circle | Full | |
| CLng | Full | |
| Close | Full | |
| Cls | Partial | No support for optional method parameter. Entire screen will be cleared regardless of selected method. |
| CSng | Full | |
| Color | Partial | RGB colors only supported when created with one of the supported RGB functions. Legacy 256 color table supported regardless of screen mode. |
| Command$ | Limited | Always returns an empty string |
| Cos | Full | |
| Csrlin | Full | |
| Cvi | Full | |
| Cvl | Full | |
| Data | Full | |
| Date$ | Full | |
| Dim | Full | |
| Draw | Full | |
| ReDim | Full | |
| Do...Loop | Full | |
| End | Partial | Optional return code parameter is ignored |
| EOF | Full | |
| Exit | Full | |
| Exp | Full | |
| Files | Full | |
| Fix | Full | |
| For...Next | Full | |
| FreeFile | Full | |
| Function | Full | |
| Get | Full | |
| Hex$ | Full | |
| If...Then | Partial | No support for "IF (condition) GOTO" |
| InKey$ | Full | |
| Input | Full | |
| Input (file statement) | Full | |
| InStr | Full | |
| Int | Full | |
| Kill | Full | |
| LBound | Full | |
| LCase$ | Full | |
| Left$ | Full | |
| Len | Full | |
| Let | Full | |
| Line | Full | |
| Line Input | Full | |
| Line Input (file statement) | Full | |
| Locate | Partial | Only monotype font 16 supported at present |
| LOF | Full | |
| Log | Full | |
| LTrim$ | Full | |
| Mid$ | Partial | Only the Mid$ function is supported at present |
| MkDir | Full | |
| Mki$ | Full | |
| Mkl$ | Full | |
| Name | Full | |
| Oct$ | Full | |
| Open | Full | |
| Paint | Partial | Tiling patterns are not currently supported for the fillColor parameter |
| Point | Full | |
| Pos | Full | |
| PReset | Full | |
| Full | ||
| Print (file statement) | Full | |
| PSet | Full | |
| Put | Full | |
| Randomize | Full | |
| Read | Full | |
| Restore | Full | |
| Rem | Full | |
| Right$ | Full | |
| RmDir | Full | |
| RTrim$ | Full | |
| Rnd | Partial | |
| Screen | Partial | Optional active_page and visual_page parameters are not supported. |
| Seek | Full | |
| Select Case | Partial | No support currently for "SELECT EVERYCASE" or "CASE [lowerValue] TO [upperValue] |
| Space$ | Full | |
| String$ | Full | |
| Sgn | Full | |
| Sin | Full | |
| Sleep | Full | |
| Sqr | Full | |
| Str$ | Full | |
| Sub | Full | |
| Swap | Full | |
| System | Partial | Optional return code parameter is ignored |
| Tan | Full | |
| Time$ | Full | |
| Timer | Partial | Not currently supporting the optional accuracy parameter. |
| UBound | Full | |
| UCase$ | Full | |
| Val | Full | |
| VarPtr$ | Full | |
| While...WEnd | Full | |
| Window | Full | |
| Write | Full | |
| Write (file statement) | Full |
| Keyword | Support | Notes |
|---|---|---|
| _Acos | Full | |
| _Acosh | Full | |
| _Alpha | Partial | Optional imageHandle parameter is not supported |
| _Alpha32 | Full | |
| _Asin | Full | |
| _Asinh | Full | |
| _Atan2 | Full | |
| _Atanh | Full | |
| _AutoDisplay | Limited | Always returns true (-1). QBJS display refresh is always handled automatically. This method is included for compatibility. |
| _BackgroundColor | Full | |
| _Blue | Partial | Optional imageHandle parameter is not supported |
| _Blue32 | Full | |
| _Ceil | Full | |
| _Continue | Full | |
| _Cosh | Full | |
| _Coth | Full | |
| _CopyImage | Full | |
| _Csch | Full | |
| _CWD$ | Full | |
| _D2G | Full | |
| _D2R | Full | |
| _DefaultColor | Partial | Optional imageHandle parameter is not supported |
| _Delay | Full | |
| _Dest | Full | |
| _DirExists | Full | |
| _Display | Limited | Sub version of this method has no effect. Function always returns 0. QBJS display refresh is handled automatically. This method is included for compatibility. |
| _FileExists | Full | |
| _Font | Partial | Optional imageHandle parameter is not supported |
| _FontHeight | Full | |
| _FontWidth | Full | |
| _FreeFont | Full | |
| _FreeImage | Full | |
| _FullScreen | Partial | At present _STRETCH and _SQUAREPIXELS and _SMOOTH keywords are ignored. All calls to _FullScreen except for _FullScreen _OFF are equivalent to the following in QB64:_FullScreen _SQUAREPIXELS _SMOOTH
|
| _G2D | Full | |
| _G2R | Full | |
| _Green | Partial | Optional imageHandle parameter is not supported |
| _Green32 | Full | |
| _Height | Full | |
| _Hypot | Full | |
| _InStrRev | Full | |
| _KeyClear | Partial | Option 3 has no effect for buffer parameter as there is no support for INP(&H60) buffer. |
| _KeyDown | Full | |
| _KeyHit | Full | |
| _Limit | Full | |
| _LoadFont | Partial | Optional style parameter is not supported |
| _LoadImage | Full | |
| _MouseButton | Full | |
| _MouseInput | Full | |
| _MouseWheel | Full | |
| _MouseX | Full | |
| _MouseY | Full | |
| _NewImage | Full | |
| _OS$ | Full | Returns WEB as the OS and the name of the browser instead of the compiler bit format (e.g. [WEB][CHROME]) |
| _PaletteColor | Full | |
| _Pi | Full | |
| _PrintMode | Partial | Optional imageHandle parameter is not supported |
| _PrintString | Partial | Optional imageHandle parameter is not supported |
| _PrintWidth | Full | |
| _PutImage | Partial | Images are not reversed when dx2 and dy2 are greater than dx1 and dy1. |
| _R2D | Full | |
| _Red | Partial | The optional imageHandle parameter is not supported |
| _Red32 | Full | |
| _Resize | Full | |
| _ResizeHeight | Full | |
| _ResizeWidth | Full | |
| _R2G | Full | |
| _ReadBit | Full | |
| _RGB | Partial | The optional imageHandle parameter is not supported |
| _RGBA | Partial | The optional imageHandle parameter is not supported |
| _RGB32 | Full | |
| _RGBA32 | Full | |
| _Round | Full | |
| _ScreenExists | Limited | Always returns true |
| _SetBit | Full | |
| _Shl | Full | |
| _Shr | Full | |
| _Sinh | Full | |
| _SndClose | Full | |
| _SndLoop | Full | |
| _SndOpen | Full | |
| _SndPause | Full | |
| _SndPlay | Full | |
| _SndStop | Full | |
| _SndVol | Full | |
| _Source | Full | |
| _StartDir | Full | |
| _StrCmp | Full | |
| _StriCmp | Full | |
| _Tanh | Full | |
| _Title | Full | |
| _ToggleBit | Full | |
| _Trim | Full | |
| _Width | Full |
| Keyword | Description |
|---|---|
| Export | Specifies a Sub, Function or Const that will be accessible in an exported module. |
| Import | Imports an external module for use in the calling program. |
| IncludeJS | Includes a javascript library for use by the current program. |
In an effort to provide the ability for the language to grow in a scalable, modular manner beyond the original QBasic and QB64 built-in keywords, QBJS has introduced the concept of importable modules. The bulk of features added beyond the original core keywords will be provided as standard, optional library modules which can be imported as needed.
Provides extended 2D graphics functionality.
Import G2D From "lib/graphics/2d.bas"| Keyword | Description |
|---|---|
| G2D.Bezier | Draws a bezier curve. |
| G2D.Curve | Draws a quadratic curve. |
| G2D.Ellipse | Draws an ellipse. |
| G2D.FillCircle | Draws a filled circle. |
| G2D.FillRoundRect | Draws a filled rectangle with rounded corners. |
| G2D.FillTriangle | Draws a filled triangle. |
| G2D.LineCap | Gets or sets the current line cap style. |
| G2D.LineWidth | Gets or sets the current line width. |
| G2D.RotoZoom | Rotates and zooms an image. |
| G2D.RoundRect | Draws a rectangle with rounded corners. |
| G2D.SaveImage | Saves an image to the virtual filesystem in PNG format. |
| G2D.Shadow | Applies a shadow effect to subsequent drawing methods. |
| G2D.ShadowOff | Turns off the shadow effect for subsequent drawing methods. |
Provides access to the console output.
Import Console From "lib/web/console.bas"| Keyword | Description |
|---|---|
| Console.Echo | Prints a message to the console. |
| Console.Log | Logs a message to the console. The log level and current program source line will prefix the written log message. |
| Console.LogLevel | Gets or sets the current console log level. |
Provides access to the current web page's document object model.
Import Dom From "lib/web/dom.bas"| Keyword | Description |
|---|---|
| Dom.Add | Adds an existing html element to a new parent element. |
| Dom.Alert | Instructs the browser to display a dialog with an optional message, and to wait until the user dismisses the dialog. |
| Dom.Confirm | Instructs the browser to display a dialog with an optional message, and to wait until the user either confirms or cancels the dialog. |
| Dom.Container | Returns the outermost containing html element for the QBJS application. |
| Dom.Create | Creates a new html element and adds it to the current page. |
| Dom.Event | Registers an event handler method that will be triggered when the specified event is fired. |
| Dom.Get | Returns an html element for a specified id. |
| Dom.GetImage | Returns the html canvas element associated with a QB image. |
| Dom.Remove | Removes an html element from the page. |
| Dom.Prompt | Instructs the browser to display a dialog with an optional message prompting the user to input some text, and to wait until the user either submits the text or cancels the dialog. |
Extended functionality for input/output related to the virtual filesystem.
Import FS From "lib/io/fs.bas"| Keyword | Description |
|---|---|
| FS.DownloadFile | Downloads a file from the virtual file system. |
| FS.ListDirectory | Lists the contents of a directory in the virtual file system. |
| FS.UploadFile | Upload a file to the virtual file system. |
Provides access to the browser local and session storage.
Import Storage From "lib/web/storage.bas"| Keyword | Description |
|---|---|
| Storage.Clear | Clears all values from the browser storage. |
| Storage.Get | Returns a value from browser storage identified by the storage key. |
| Storage.Key | Returns the key from browser storage identified by the key's index. |
| Storage.Length | Returns the number of values stored in browser storage. |
| Storage.Remove | Removes a value from browser storage identified by the storage key. |
| Storage.Set | Sets value in browser storage identified by the storage key. |