FreeBASIC

From Wikipedia, the free encyclopedia

FreeBASIC
The FreeBASIC Logo
Paradigm: Procedural
Appeared in: 2004
Developer: Andre Victor
Latest release: 0.16 Beta / 2006-06-11
Typing discipline: Static
Dialects: BASIC
Influenced by: QuickBASIC, C
OS: DOS, Linux, Windows
License: GNU GPL
Website: http://www.freebasic.net

FreeBASIC is a free/open source (GPL), 32-bit BASIC compiler for Microsoft Windows (32-bit), protected-mode DOS (DOS extender), the Xbox and Linux (x86), and is being ported to other platforms.

It makes use of the GNU binutils programming tools as backends and can produce console, QuickBasic-compatible graphical and GUI executables, besides dynamic and static libraries. A GCC frontend is currently being developed, which will enable compilation for many more operating systems than currently supported.

Currently, software libraries like GTK+, GSL, SDL, Allegro, Lua and OpenGL can be used directly (read: No wrappers, only function and structure prototypes), and more are being added on every new release. A complete set of the Windows API headers is also included.

Contents

FreeBASIC attempts to stay as close to the BASIC syntax as possible, specifically QuickBASIC's syntax. While FreeBASIC does attempt to stay true to its predecessor syntax-wise, it has added the following features:

Lines of code are ended with either a colon, or when the line ends. Comments can be made either to comment an entire line, or a block of code such. Full line comments are made with ', while blocks of commented code are created via /' and ended with '/.

UDT's and child types are separated by .'s (as in many other languages). Pointers are dereferenced via * or ->, as in C; taking the address of an object is done with @ (roughly equivalent to C's &).

The latest version in development, 0.17, adds object orientation support, but removes support for the following features if the -lang qb or -lang deprecated command-line options are not used:

  • implicit variables
  • suffixes (! # $ % &)
  • default BYREF parameters
  • OPTION's of any kind
  • periods in symbol names
  • GOSUB/RETURN
  • ON .. GOSUB|GOTO
  • ON ERROR | RESUME
  • '$DYNAMIC, '$STATIC, '$INCLUDE meta-commands
  • CALL or LET
  • Numeric labels


Print "Hello, World!"
Sleep

More recent builds of FreeBASIC have a built-in 2d graphics library that provides graphics primitives (such as rectangles, lines, and circles), blitting, and alpha blending, among other things. Graphics in FreeBASIC is highly optimized, providing a fast, practical framework without the developer having to worry about specific implementation issues. For this reason, one of the most common uses for FreeBASIC is game development.

Currently, there are plans to incorporate object-oriented syntax into FreeBasic. As of January 20, 2007, FreeBasic supports nearly all aspects of object-oriented programming, with the exceptions of inheritance and polymorphism.

  • The FreeBASIC compiler is self-hosting and is nearly 90,000 lines of code.
  • The first version of the compiler was written in Visual Basic for DOS.


Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.