|Designed by||Andre Victor|
|Developer||The FreeBASIC Development Team|
1.05.0 / January 31, 2016
|OS||MS-DOS, FreeBSD, Linux, Microsoft Windows|
|License||GNU GPLv2+, Standard libraries licensed under the GNU LGPLv2+|
According to its official Web site, FreeBASIC provides syntax compatibility with programs originally written in Microsoft QuickBASIC (QB). Unlike QuickBASIC, however, FreeBASIC is a command line only compiler, unless users manually install an external integrated development environment (IDE) of their choice. IDEs specifically made for FreeBASIC include FBide and FbEdit.
On its back end, FreeBASIC makes use of GNU Binutils in order to produce console and graphical user interface applications. FreeBASIC supports the linking and creation of C static and dynamic libraries and has limited support for C++ libraries. As a result, code compiled in FreeBASIC can be reused in most native development environments.
C style preprocessing, including multiline macros, conditional compiling and file inclusion, is supported. The preprocessor also has access to symbol information and compiler settings, such as the language dialect.
Initially, FreeBASIC emulated Microsoft QuickBASIC syntax as closely as possible. Beyond that, the language has continued its evolution. As a result, FreeBASIC combines several language dialects for maximum level of compatibility with QuickBASIC and full access to modern features. New features include support for concepts such as objects, operator overloading, function overloading, namespaces and others.
Newline characters indicate the termination of programming statements. A programming statement can be distributed on multiple consecutive lines by using the underscore line continuation char (_), whereas multiple statements may be written on a single line by separating each statement with a colon (:).
FreeBASIC is not case-sensitive.
FreeBASIC provides built-in, QuickBASIC compatible graphics support through FBgfx, which is automatically included into programs that make a call to the
SCREEN command. Its backend defaults to OpenGL on Linux and DirectX on Microsoft Windows. This abstraction makes FBgfx graphics code cross-platform compatible. However, FBgfx is not hardware accelerated.
Users familiar with external graphics utilities such as OpenGL or the Windows API can use them without interfering with the built-in graphics library.
As FreeBASIC has evolved, changes have been made that required breaking older-styled syntax. In order to continue supporting programs written using the older syntax, FreeBASIC now supports the following dialects:
- The default dialect (-lang fb as a command-line argument) supports all new compiler features and disallows archaic syntax.
- The FB-lite dialect (-lang fblite) permits use of most new, non-object-oriented features in addition to older-style programming. Implicit variables, suffixes,
RETURN, numeric labels and other features are allowed in this dialect.
- The QB dialect (-lang qb) attempts to replicate QuickBASIC behavior and is able to compile many QuickBASIC programs without modification.
Standard programs, such as the "Hello, World!" program are done just as they were in QuickBASIC.
Print "Hello, World!" sleep:end 'Comment, prevents the program window from closing instantly
Type Vector Private: x As Integer y As Integer Public: Declare Constructor (nX As Integer = 0, nY As Integer = 0) Declare Property getX As Integer Declare Property getY As Integer End Type Constructor Vector (nX As Integer, nY As Integer) x = nX y = nY End Constructor Property Vector.getX As Integer Return x End Property Property Vector.getY As Integer Return y End Property
Dim As Vector Ptr player = New Vector() *player = Type<Vector>(100, 100) Print player->getX Print player->getY Delete player Sleep 'Prevents the program window from closing instantly
In both cases, the language is well suited for learning purposes.
- "freeBASIC about page". freeBASIC compiler. Retrieved 5 February 2012.
- FBWiki : FaqPgxbox
- freeBASIC Programming Language: Official Web site
- "freeBASIC official website downloads page". freeBASIC compiler. Retrieved 13 May 2017.
- FbEdit on sourceforge, retrieved 13 May 2017
- "freeBASIC dialects". coderJeff's home page. Retrieved 5 February 2012.
- "Differences from QB". freeBASIC.net documentation. Retrieved 5 February 2012.
|Wikimedia Commons has media related to:|
- WinFBE - Modern FreeBASIC Editor for Windows
- fbide.freebasic.net — FBIDE Integrated Development Environment for freeBASIC
- FBEdit (current) — FBEdit source code editor for FreeBASIC, version 184.108.40.206c
- FBEdit source code editor for freeBASIC (outdated version: 220.127.116.11) on SourceForge.net