Most Important Features
- FreeBASIC is not a "new" BASIC language. You don't need to learn much new if you are familiar with any Microsoft-BASIC variant. You can use either "-lang qb" for compatibility, or (default) "-lang fb" for some of the new features, but it also brings some restrictions and some similarity with the "C" programming language. See also CompilerDialects.
- FreeBASIC is case-insensitive; explicit "main" procedure is not required; most of the graphic and console statements and procedures found in Microsoft QuickBASIC are implemented, et cetera.
- Only with "-lang qb": scalar variables don't need to be dimensioned and suffixes can be used; line numbers are supported; Gosub supported.
Thin bindings (header files) to existing C libraries and APIs
- Only a small number of keywords have been added. All procedures are implemented as libraries, so for the most part, there are no new intrinsic routines, and therefore there is a low chance of having name duplication with old code.
- No wrappers or helpers are necessary, just a ported header file, making usage of external C libraries very easy
- The official distribution comes with several bindings to existing C libraries already, see External Libraries TOC for a complete up-to-date list
- FreeBASIC currently runs on 32-bit Windows, Linux, and DOS (a 16-bit DOS is good enough, although FreeBASIC itself and compiler output are 32-bit) and also creates applications for the Xbox console. More platforms to come.
- The runtime library was written with portability in mind. All third-party tools used exist on most operating systems already as they are from the GNU binutils. The compiler is written in 100% FreeBASIC code (that is, FreeBASIC compiles itself.), which makes it simple to be bootstrapped as it doesn't depend on non-portable tools.
A large number of built-in data types
- Besides ASCII files with Unicode escape sequences (\u), FreeBASIC can parse UTF-8, UTF-16LE, UTF-16BE, UTF-32LE and UTF-32BE source (.bas) or header (.bi) files, they can be freely mixed with other sources/headers in the same project (also with other ASCII files).
- Literal strings can be typed in the original non-Latin alphabet, just use a text-editor that supports some of the Unicode formats listed above.
- The Wstring type holds wide-characters, all string procedures (like Left, Trim, etc) will work with wide-strings too.
- Open was extended to support UTF-8, UTF-16LE and UTF-32LE files with the Encoding specifier. Input # and Line Input #, as well as Print # and Write # can be used normally, and any conversion between Unicode to ASCII is done automatically if necessary.
- Print also supports Unicode output (see Requirements).
User-defined types (UDTs)
- Integer: Byte, Ubyte, Short, Ushort, Integer, UInteger, Long, ULong, Longint, Ulongint
- Floating-point: Single, Double
- String: fixed, variable-length or null-terminated (Zstring), up to 2GB long
- Unicode strings (Wstring), like Zstring, but with support for wide characters. Use the Windows Unicode API procedures directly, etc.
- Unlimited nesting.
- BASIC's Type statement is supported, along with the new Union statement (including anonymous nested unions).
- Array fields utilizing up to eight dimension