{{fbdoc item="title" value="Most Important Features"}}----

{{fbdoc item="section" value="BASIC compatibility"}}
	- ""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; ##[[KeyPgGosub|Gosub]]## supported.

{{fbdoc item="section" value="Clean syntax"}}
	- 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.

{{fbdoc item="section" value="Thin bindings (header files) to existing C libraries and APIs"}}
	- 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 [[ExtLibTOC|External Libraries TOC]] for a complete up-to-date list

{{fbdoc item="section" value="Multi-platform"}}
	- ""FreeBASIC"" supports native or cross-target builds for DOS, Windows, Windows CE, Linux, Android, JavaScript/Emscripten, Darwin/macOS, Cygwin, BSD systems, Haiku, Solaris/illumos, NuttX, RISC OS, AROS, Wii homebrew, and the original Xbox.  See ##[[CompilerOpttarget|-target]]## for the current target identifiers and limits.
	- The compiler and runtime support x86, x86-64, ARM, AArch64, PowerPC, RISC-V, s390x, LoongArch64, m68k, and MIPS families where the selected operating-system target provides a working toolchain and runtime layer.
	- The runtime library was written with portability in mind.  Target-specific compiler, runtime, graphics, and sound work is kept in platform directories.  The compiler is self-hosting, and the build system can emit bootstrap sources for targets that cannot run the build-host compiler.

{{fbdoc item="section" value="Unicode support"}}
	- Besides ASCII files with [[Unicode|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|Unicode]] formats listed above.
	- The ##[[KeyPgWstring|Wstring]]## type holds wide-characters, all string procedures (like ##[[KeyPgLeft|Left]]##, ##[[KeyPgTrim|Trim]]##, etc) will work with wide-strings too.
	- ##[[KeyPgOpen|Open]]## was extended to support UTF-8, UTF-16LE and UTF-32LE files with the ##[[KeyPgEncoding|Encoding]]## specifier. ##[[KeyPgInputPp|Input #]]## and ##[[KeyPgLineinputPp|Line Input #]]##, as well as ##[[KeyPgPrintPp|Print #]]## and ##[[KeyPgWritePp|Write #]]## can be used normally, and any conversion between [[Unicode|Unicode]] to ASCII is done automatically if necessary.
	- ##[[KeyPgPrint|Print]]## also supports [[Unicode|Unicode]] output (see Requirements).

{{fbdoc item="section" value="A large number of built-in data types"}}
	- Integer: ##[[KeyPgByte|Byte]]##, ##[[KeyPgUbyte|Ubyte]]##, ##[[KeyPgShort|Short]]##, ##[[KeyPgUshort|Ushort]]##, ##[[KeyPgInteger|Integer]]##, ##[[KeyPgUinteger|UInteger]]##, ##[[KeyPgLong|Long]]##, ##[[KeyPgUlong|ULong]]##, ##[[KeyPgLongint|Longint]]##, ##[[KeyPgUlongint|Ulongint]]##
	- Floating-point: ##[[KeyPgSingle|Single]]##, ##[[KeyPgDouble|Double]]##
	- String: fixed, variable-length or null-terminated (##[[KeyPgZstring|Zstring]]##), up to 2GB long
	- [[Unicode|Unicode]] strings (##[[KeyPgWstring|Wstring]]##), like ##[[KeyPgZstring|Zstring]]##, but with support for wide characters. Use the Windows [[Unicode|Unicode]] API procedures directly, etc.

{{fbdoc item="section" value="User-defined types (UDTs)"}}
	- Unlimited nesting.
	- BASIC's ##[[KeyPgType|Type]]## statement is supported, along with the new ##[[KeyPgUnion|Union]]## statement (including anonymous nested unions).
	- Array fields utilizing up to eight dimensions can be used.
	- Procedure pointer fields.
	- Bit fields.
  	
{{fbdoc item="section" value="Enumerations (enums)"}}
	- Easily declare a list of constants with sequential values with ##[[KeyPgEnum|Enum]]##.

{{fbdoc item="section" value="Arrays"}}
	- Fixed- and variable- length arrays are supported, up to 2 GB in size.
	- Up to eight dimensions, including arrays with unknown dimensions.
	- Any lower and upper boundaries.
	- Element data can be preserved during a re-size of variable-length arrays with ##[[KeyPgRedim|Redim]]## using the new ##[[KeyPgPreserve|Preserve]]## specifier.

{{fbdoc item="section" value="Pointers"}}
	- Pointers to any of the data types listed above, including string characters, array elements and UDT's.
	- Uses the same syntax as C.
	- Unlimited indirection levels (e.g., pointer to pointer to ...).
	- Procedure pointers.
	- Indexing []'s (including string indexing).
	- Type casting.
  
{{fbdoc item="section" value="Variable, object and array initialization"}}
	- For static, module-level or local variables, arrays and UDT's.

{{fbdoc item="section" value="Default procedure parameter values"}}
	- For numeric, string and UDT parameter types.
  
{{fbdoc item="section" value="Procedure overloading"}}
	- Including procedures with default parameter values.

{{fbdoc item="section" value="In-line assembly"}}
	- Intel syntax.
	- Reference variables directly by name; no "trick code" needed.

{{fbdoc item="section" value="Traditional preprocessor support"}}
	- Same syntax as in C.
	- Single-line macros supported with the ##[[KeyPgPpdefine|#Define]]## command, including parameters.
	- Multi-line macros supported with the ##[[KeyPgPpmacro|#Macro]]## command.

{{fbdoc item="section" value="Type aliases"}}
	- Supporting forward referencing as in C, including UDT and procedure pointer types.

{{fbdoc item="section" value="C-like escape sequences for string literals"}}
	- Same as in C (except numbers are interpreted as decimal, not octal).

{{fbdoc item="section" value="Debugging support"}}
	- Full debugging support with //GDB// (the GNU debugger) or //Insight// (a //GDB// GUI frontend).
	- Array bounds checking (only enabled by the ##-exx## command-line option).
	- Null pointer checking (same as above).

{{fbdoc item="section" value="Create OBJ's, LIB's, DLL's, and console or GUI EXE's"}}
	- You are in no way locked to an IDE or editor of any kind.
	- You can create static and dynamic/shared libraries adding just one command-line option (##-lib## or ##-dylib/-dll##).

{{fbdoc item="section" value="Capacity and native word sizes"}}
	- Native integer and pointer sizes follow the selected target.  Both 32-bit and 64-bit targets are supported, and cross compilation must use headers and libraries built for the same ABI.
	- Source size, symbol count, generated output, and link capacity are bounded by available address space, memory, filesystem limits, and the selected backend and toolchain.  Large programs are better built with a 64-bit host compiler when one is available.

{{fbdoc item="section" value="Optimized code generation"}}
	- ""FreeBASIC"" performs language-level and backend-specific optimizations.  The GCC and clang C backends can use the target compiler's optimizer across the wider architecture set; the native GAS and GAS64 backends retain specialized x86 and x86-64 code generation.

{{fbdoc item="section" value="Built-in graphics, sound, and networking"}}
	- gfxlib2 provides the portable graphics command set.  The optional ##[[GfxLib3|gfxlib3]]## runtime adds render-threaded Vulkan/OpenGL/OpenGL ES operation on its supported hosts.
	- ##[[CatPgSfx|sfxlib]]## provides generated sound, PLAY strings, samples, music, MIDI, device selection, and capture through platform audio backends.
	- ##[[KeyPgOpenTcp|OPEN TCP]]## and ##[[KeyPgOpenTcpServer|OPEN TCP SERVER]]## provide portable stream networking, with optional serial, wire-format, GPIO, and browser WebSocket headers for their supported targets.

{{fbdoc item="section" value="Completely free"}}
	- All third-party tools are also free. No piece of abandoned or copyrighted software is used (except ""GoRC"" on ""Win32""). The assembler, linker, librarian/archiver, and other command-line applications come from the GNU binutils programming tools.

{{fbdoc item="back" value="FBWiki|Main Page"}}
