Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
FreeBASIC
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Compiler features== On its [[Front and back ends|backend]], FreeBASIC makes use of [[GNU Binutils]] in order to produce console and [[graphical user interface]] applications. FreeBASIC supports the linking and creation of [[C (programming language)|C]] static and dynamic [[library (computing)|libraries]] and has limited support for [[C++]] libraries. As a result, code compiled in FreeBASIC can be reused in most native development environments. While not an [[optimizing compiler]], FreeBASIC can optionally [[Source-to-source compiler|transcompile]] to C to compile with optimizations. FreeBASIC supports [[Inline assembler|inline assembly]], [[Multithreading (software)|multi-threading]], and does not use [[automatic garbage collection]]. [[C preprocessor|C style preprocessing]], including multiline [[macro (computer science)#Text-substitution macros|macros]], conditional compiling and file inclusion, is supported. The preprocessor also has access to symbol information and compiler settings, such as the [[Dialect (computing)|language dialect]]. ===Syntax=== 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.<ref>{{cite web|title=freeBASIC dialects|url=http://www.execulink.com/~coder/freebasic/compare.html|work=coderJeff's home page|access-date=5 February 2012}}</ref> New features include support for concepts such as [[object (computer science)|object]]s, [[operator overloading]], [[function overloading]], [[namespace]]s and others.<ref>{{cite web|title=Differences from QB|url=http://www.freebasic.net/wiki/wikka.php?wakka=LangQB|work=freeBASIC.net documentation|access-date=5 February 2012}}</ref> [[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 (punctuation)|colon]] (:). Block [[comment (computer programming)|comments]], as well as end-of-line remarks are supported. Full line comments are made with an [[apostrophe]] <code>'</code>, while blocks of commented code begin with <code>/'</code> and end with <code>'/</code>. FreeBASIC is not case-sensitive. ===Graphics library=== FreeBASIC provides built-in, QuickBASIC compatible graphics support through FBgfx, which is automatically included into programs that make a call to the <code>SCREEN</code> 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. ===Language dialects=== 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 interface#Arguments|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, <code>[[GOSUB]]</code> / <code>RETURN</code>, [[line number|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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)