SmallBASIC is a BASICprogramming languagedialect with interpreters released as free software under the GNU General Public License version 3 for Windows, Linux and Android.
The dialect is described by the authors as a second generation BASIC, and has a lot in common with QBasic. SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a string library, system, sound, and graphic commands along with structured programming syntax.
The "Small" prefix in the name SmallBASIC reflects the project's original intention of being used with the Palm, a small hand-held device. SmallBASIC was designed for portability, and is written in C with separate modules containing any code that is unique to a particular platform.[2][3]
SmallBASIC is intended to support the same sorts of applications supported by GW-BASIC and QBasic on the IBM PC, with support for drawing geometric primitives, playing sounds, String Manipulation, and displaying text in various fonts. SmallBASIC also adds functions such as "File Save", "Save As", "Close File", and "Open File" to the Palm, a device with no native filesystem. SmallBASIC is also intended as a tool for mathematics, with built-in functions for Unit conversion, Algebra, Matrix math, Trigonometry, Statistics, and for two and three dimensional Equation Graphing.[2][3]
SmallBASIC was designed to run on minimal hardware. One of the primary platforms supported was Palm OS,[4] where memory, CPU cycles, and screen space were limited. The SmallBASIC graphics engine could use ASCII graphics (similar to ASCII art) and therefore ran many programs on pure text devices. SmallBASIC runs even on Palm OS wristwatches made by Fossil, Inc.
SmallBASICは、すべてのPOSIX準拠オペレーティングシステム(Linux、BSD、UNIXを含む)[ 5 ] 、 MS-DOS / DJGPP [ 6 ] 、Win32 [ 7 ] 、FLTK [ 8 ]、VTOS [ 8 ] 、 Franklin eBookMan [ 9 ] 、Cygwin / MingW [ 10 ]、Helio/VT-OS [ 11 ] 、Android [ 12 ] 、 Nokia N770インターネットタブレット[ 13 ] 、およびSDL、FLTK、SVGALib、Linuxフレームバッファ、またはWindows GUIをサポートするすべてのシステムで使用できます。
SmallBASICの構文はQBasicと多くの共通点があります。 行番号は不要で、文は改行で終了します。複数の文を1行に記述する場合は、各文をコロン(:)で区切ります。
「Hello, World!」プログラムの例は次のとおりです。
「こんにちは、世界!」と印刷するSmallBASICで画像ファイルを読み込んで画像を表示する方法の例を以下に示します。
I = IMAGE ( "image_name.png" ) 'PNGファイルを読み込むI . SHOW ( 100 , 100 ) '座標100,100に画像を表示するSmallBASICが提供する機能を拡張するために、外部モジュールをC言語で記述することができます。 [ 14 ]バージョン12.20以降、Raylib、Nuklear、WebSocketsのモジュールがリリースに含まれています。[ 15 ]さらに、 Raspberry PiのGPIOコネクタにアクセスするためのロード可能なモジュールも存在します。[ 16 ]
。
{{cite web}}: CS1メンテナンス: アーカイブサービスは非推奨になりました (リンク)