fbpx
Wikipedia

FreeBASIC

FreeBASIC is a free and open source multiplatform compiler and programming language based on BASIC licensed under the GNU GPL for Microsoft Windows, protected-mode MS-DOS (DOS extender), Linux, FreeBSD and Xbox. The Xbox version is no longer maintained.[2]

FreeBASIC
ParadigmProcedural, object-oriented
Designed byAndre Victor[1]
DeveloperThe FreeBASIC Development Team
First appeared2004; 19 years ago (2004)
Stable release
1.10.0 / May 15, 2023; 5 months ago (2023-05-15)
Typing disciplineStatic
OSMS-DOS, FreeBSD, Linux, Microsoft Windows
LicenseGNU GPLv2+, Standard libraries licensed under the GNU LGPLv2+
Websitewww.freebasic.net
Influenced by
QuickBASIC, C

According to its official website,[3] 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.[4] IDEs specifically made for FreeBASIC include FBide and FbEdit,[5] while more graphical options include WinFBE Suite and VisualFBEditor.[6][7]

Compiler features Edit

On its 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 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.

Syntax Edit

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.[8] New features include support for concepts such as objects, operator overloading, function overloading, namespaces and others.[9]

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 (:).

Block comments, as well as end-of-line remarks are supported. Full line comments are made with an apostrophe ', while blocks of commented code begin with /' and end with '/.

FreeBASIC is not case-sensitive.

Graphics library Edit

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.

Language dialects Edit

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, GOSUB / 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.

Example code Edit

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 

FreeBASIC adds to this with support for object-oriented features such as methods, constructors, dynamic memory allocation, properties and temporary allocation.

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.

References Edit

  1. ^ "freeBASIC about page". freeBASIC compiler. Retrieved 5 February 2012.
  2. ^ FBWiki : FaqPgxbox
  3. ^ freeBASIC Programming Language: Official Web site
  4. ^ "freeBASIC official website downloads page". freeBASIC compiler. Retrieved 13 May 2017.
  5. ^ FbEdit on sourceforge, retrieved 13 May 2017
  6. ^ Speed, Richard (2022-05-06). "RAD Basic – the Visual Basic 7 that never was – releases third alpha". The Register. Retrieved 2023-03-26. RAD Basic is not the only game in town. Alternatives in varying stages of development include twinBASIC, which also aims to be backwards compatible with VB6 and VBA; and FreeBASIC, which implements much of what lurked in Microsoft QuickBASIC (and has a nifty IDE in the form of VisualFBEditor).
  7. ^ FreeBASIC IDEs/Editors - FreeBASIC Forums
  8. ^ "freeBASIC dialects". coderJeff's home page. Retrieved 5 February 2012.
  9. ^ "Differences from QB". freeBASIC.net documentation. Retrieved 5 February 2012.

External links Edit

IDEs
  • WinFBE - Modern FreeBASIC Editor for Windows
  • VisualFBEditor - Cross-platform graphical IDE
  • fbide.freebasic.net  — FBIDE Integrated Development Environment for freeBASIC
  • FBEdit (current)  — FBEdit source code editor for FreeBASIC, version 1.0.7.6c
  • FBEdit source code editor for freeBASIC (outdated version: 1.0.6.8) on SourceForge

freebasic, confused, with, free, basics, free, open, source, multiplatform, compiler, programming, language, based, basic, licensed, under, microsoft, windows, protected, mode, extender, linux, freebsd, xbox, xbox, version, longer, maintained, paradigmprocedur. Not to be confused with Free Basics FreeBASIC is a free and open source multiplatform compiler and programming language based on BASIC licensed under the GNU GPL for Microsoft Windows protected mode MS DOS DOS extender Linux FreeBSD and Xbox The Xbox version is no longer maintained 2 FreeBASICParadigmProcedural object orientedDesigned byAndre Victor 1 DeveloperThe FreeBASIC Development TeamFirst appeared2004 19 years ago 2004 Stable release1 10 0 May 15 2023 5 months ago 2023 05 15 Typing disciplineStaticOSMS DOS FreeBSD Linux Microsoft WindowsLicenseGNU GPLv2 Standard libraries licensed under the GNU LGPLv2 Websitewww wbr freebasic wbr netInfluenced byQuickBASIC CAccording to its official website 3 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 4 IDEs specifically made for FreeBASIC include FBide and FbEdit 5 while more graphical options include WinFBE Suite and VisualFBEditor 6 7 Contents 1 Compiler features 1 1 Syntax 1 2 Graphics library 1 3 Language dialects 2 Example code 3 References 4 External linksCompiler features EditOn its 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 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 Syntax Edit 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 8 New features include support for concepts such as objects operator overloading function overloading namespaces and others 9 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 Block comments as well as end of line remarks are supported Full line comments are made with an apostrophe while blocks of commented code begin with and end with FreeBASIC is not case sensitive Graphics library Edit 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 Language dialects Edit 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 a href GOSUB html class mw redirect title GOSUB GOSUB a 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 Example code EditStandard 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 FreeBASIC adds to this with support for object oriented features such as methods constructors dynamic memory allocation properties and temporary allocation 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 lt Vector gt 100 100 Print player gt getX Print player gt getY Delete player Sleep Prevents the program window from closing instantly In both cases the language is well suited for learning purposes References Edit nbsp Free and open source software portal 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 Speed Richard 2022 05 06 RAD Basic the Visual Basic 7 that never was releases third alpha The Register Retrieved 2023 03 26 RAD Basic is not the only game in town Alternatives in varying stages of development include twinBASIC which also aims to be backwards compatible with VB6 and VBA and FreeBASIC which implements much of what lurked in Microsoft QuickBASIC and has a nifty IDE in the form of VisualFBEditor FreeBASIC IDEs Editors FreeBASIC Forums freeBASIC dialects coderJeff s home page Retrieved 5 February 2012 Differences from QB freeBASIC net documentation Retrieved 5 February 2012 External links Edit nbsp Wikimedia Commons has media related to FreeBASIC category Official website FreeBASIC on GitHub FreeBASIC on SourceForgeIDEsWinFBE Modern FreeBASIC Editor for Windows VisualFBEditor Cross platform graphical IDE fbide freebasic net FBIDE Integrated Development Environment for freeBASIC FBEdit current FBEdit source code editor for FreeBASIC version 1 0 7 6c FBEdit source code editor for freeBASIC outdated version 1 0 6 8 on SourceForge Retrieved from https en wikipedia org w index php title FreeBASIC amp oldid 1158065023, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.