SmallBASIC explained

SmallBASIC
License:GPL 3
Website:smallbasic.github.io
File Ext:.bas
Latest Release Version:12.27 (Windows/Linux/Android)[1]
Programming Language:BASIC

SmallBASIC is a BASIC programming language dialect with interpreters released as free software under the GNU General Public License version 3 for Microsoft Windows, Linux and Android.

Description

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.

Intended application

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 Graphic Primitives to the screen, creating 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.

History

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.

Platforms

SmallBASIC is available for all POSIX-Compliant operating systems (including Linux, BSD, and UNIX),[5] DOS/DJGPP,[6] Win32,[7] FLTK,[8] VTOS, Franklin eBookMan,[9] Cygwin/MingW,[10] Helio/VT-OS,[11] Android,[12] the Nokia N770 Internet Tablet.,[13] and on any system that supports SDL, FLTK, SVGALib, Linux framebuffer, or Windows GUI.

Syntax

The syntax of SmallBASIC has a lot in common with QBasic. Line numbers are not required, and statements are terminated by newlines. Multiple statements may be written on a single line by separating each statement with a colon (:)

An example "Hello, World!" program is:

PRINT "Hello, World!"

An example of how SmallBASIC allows to load an image file and display the image:

I = IMAGE("image_name.png") 'Loads a png fileI.SHOW(100,100) 'shows the image on screen at the coordinates 100,100

Loadable modules

External modules can be written in C to extend the functionality provided by SmallBASIC.[14] Since version 12.20 modules for Raylib, Nuklear and WebSockets are included in the release.[15] Additionally a loadable module to access the GPIO connector of the Raspberry Pi exists.[16]

Reception

See also

External links

Notes and References

  1. Web site: Browse Files for SmallBASIC . 26 April 2024 . 23 May 2024 .
  2. Web site: About SmallBASIC . https://web.archive.org/web/20071112084122/http://www.ascii-world.com/about-smallbasic . dead . 12 November 2007 . ASCII-World . 22 February 1999 . 19 January 2011 .
  3. http://gnosis.cx/publish/programming/palm_languages.html PalmOS Hosted Programming Languages
  4. http://freshmeat.net/articles/palmos-software Freshmeat.net
  5. Web site: SourceForge.net Repository - Unix . Smallbasic.svn.sourceforge.net . 2011-01-22.
  6. Web site: SourceForge.net Repository - DOS-DJGPP . Smallbasic.svn.sourceforge.net . 2011-01-22.
  7. Web site: SourceForge.net Repository - WIN32 . Smallbasic.svn.sourceforge.net . 2011-01-22.
  8. Book: Robot builder's sourcebook . registration . 411 . SmallBASIC. . McGraw-Hill Professional. Gordon McComb. 0-07-140685-9 . 2002 . 19 January 2011.
  9. Web site: SourceForge.net Repository - EBM . Smallbasic.svn.sourceforge.net . 2011-01-22.
  10. Web site: Sigwin/MinG . Smallbasic.svn.sourceforge.net . 2011-01-22.
  11. Web site: SourceForge.net Repository - Helio . Smallbasic.svn.sourceforge.net . 2011-01-22.
  12. Web site: SourceForge.net Repository - Android . Smallbasic.svn.sourceforge.net . 2011-01-22.
  13. Web site: SmallBASIC - N770 at . Sourceforge.net . 2011-01-22.
  14. Web site: SmallBASIC plugins . . 22 March 2022.
  15. Web site: SmallBASIC Home Page . 22 March 2022.
  16. Web site: SmallBASIC PiGPIO Home Page . 22 March 2022.
  17. Web site: McPherson . James . Development in the palm of your hand, part 2 . Articles.techrepublic.com.com . 4 June 2001 . 19 January 2011 . https://archive.today/20120904213009/http://www.techrepublic.com/article/development-in-the-palm-of-your-hand-part-2/5031775 . 4 September 2012 . dead .