For beginner, for guru

thinBASIC is a BASIC programming language for Windows.

Features

Easy

Easy ThinBASIC is easy to learn

ThinBASIC took the core concept of BASIC - keeping programming simple and fun - and adjusts it for the modern times.
Load file, download web page or print to console using single line of code.

Organized

Organized One file/mutiple files

Script code is not limited to a single file, but you can include other script files to better structure your project.

Modular

Modular Only modules you need

The thinBasic core provides the very essence of the language, such as numeric and string variable types, flow control, and the most essential functions.
Area specific functionality is added via modules - dedicated libraries of functions for user interface, file handling, graphics, sound, printer control and more.

Multi-paradigmatic

Multi-paradigmatic Precedural or OOP or both

There are languages which are purely procedural, there are languages which are purely object oriented.
ThinBASIC does not force you to one paradigm.
You are free to choose the right approach for each solution.

Extensible

Extensible Add your own personal modules

ThinBASIC can be extended via compiled modules written in PowerBASIC, FreeBasic, Rust, C, or in general any programming language able to develop a 32bit Dll.

Interpreted & pseudocompiled

Interpreted & pseudocompiled The choice is your

The language is interpreted, which means you start the script immediately, without wait for compilation.
Yet - you can also distribute your scripts as single EXE file, thanks to so called bundling.

Complete package

thinAir

thinAir ThinBASIC IDE: Integrated Development Environment

Developed and maintained directly by thinBASIC authors, thinAir is the official script editor. Many easy-to-use features make thinBasic programmer’s day more productive.
It allows creating new scripts from templates, debugging and offers and complete document outline as well, for easier navigation between types and functions.

thinDebug

thinDebug ThinBASIC Debugger

Unlike some other interpreters, thinBasic does support stepping through the code line by line in interactive mode, while allowing to skip directly to a user defined breakpoints.
It also allows variable inspection in multiple scopes, while providing detailed information even for more complex structures such as arrays or user defined types.

thinBundle

thinBundle ThinBASIC pseudo compiler

Any thinBasic script can be converted to EXE file, directly with this official tool. You can provide the EXE with the usual metadata, such as version information, custom icon and more.
This is the tool of choice when you need to ship your application to somebody without thinBasic installation. Just click a button and create an independent EXE file.

Help

thinHelp

thinDebug ThinBASIC offline help

Learning a new programming language is very difficult without a complete help that explain programming language features.
thinBasic is distributed with a full help file that explains the thousands of commands present into the programming language.

Online Help

online help ThinBASIC online help

An online help is also available.
It can be used to learn thinBasic while online or to reference help pages in thinBasic community forum.

Examples

examples ThinBASIC Examples

Once installed more than 600 thinBasic script source code examples will help programmers to study thinBasic language and cover many programming aspects from file handling to web service calling to databases interaction to windows forms creation ... and much much more.

Tutorials

Few little code snipets showing some of thinBasic syntax

How to define a variable

' Verbose syntax
dim myNumber  as long     ' define a 32bit integer variable
dim myDecimal as single ' define single precision variable
dim myText    as string ' define a string variable

' Brief syntax + initialization
long   myNumber  = 123
single myDecimal = 1.23
string myText    = "Ciao"

' Brief syntax + initialization + bit oriented naming
int32   myNumber = 123  ' 32bit integer
float32 myDecimal= 1.23 ' 32bit float

' Scope definition + intialization
dim    myVal   as long = 5   ' variable scope deduced from location
global counter as long = 1   ' global scope forced
local  temp    as long = 456 ' local scope forced

Console Hello world

Uses "Console" '---Load Console module
Printl "Hello world"
WaitKey

File Load

'---Load a file content up to 1GB of data
Uses "File" '---Load File module
String sBuffer = File_Load("FullFileName")

Create a function

Function RealLen(Byval s As String) As Long
  Function = Len(Trim$(s))
End Function

Ping a web site

uses "iNet"
uses "TcpUdp"
uses "Console"

string sHost    = "www.thinbasic.com"
string sIP      = IP_ToString(HOSTNAME_TOIP(sHost))
string sData    = "abcdefghijklmnopqrstuvwxyz"
string sPingBuffer

printl "Pinging", sHost, "[" + sIP + "]", "with", len(sData), "bytes od data:"
while %TRUE
  sPingBuffer = INET_Ping(sHost, 1000, sData)

  '---All OK
  if val(parse$(sPingBuffer, $tab, 2)) = 0 Then
    printl time$, sPingBuffer in %CCOLOR_FLIGHTGREEN
  Else
    '---KO
    printl time$, sPingBuffer in %CCOLOR_FLIGHTRED
  end If
  sleep 1000
Wend

Downloads

thinBasic 1.9.16.17

Old version

Compatible from W2k or higher

Date released: 2016.08.14

Features: all the features of previous thinBasic versions plus the following

thinBasic 1.10.6

Recent version

Compatible from W7 or higher

Date released: 2019.01.19

Features: all the features of previous thinBasic versions plus the following

thinBasic 1.10.7

New version

Compatible from W7 or higher

Date released: 2019.05.26

Features: all the features of previous thinBasic versions plus the following

Support