More about FreeBASIC

The FreeBASIC project is a set of cross-platform development tools initially created by Andre Victor, consisting of a compiler, GNU-based assembler, linker and archiver, and supporting runtime libraries, including a software-based graphics library. The compiler, fbc, currently supports building for i386-based architectures on the DOS, Linux, Windows and Xbox platforms. The project also contains thin bindings (header files) to some popular 3rd party libraries such as the C runtime library, Allegro, SDL, OpenGL, GTK+, the Windows API and many others, as well as example programs for many of these libraries.FreeBASIC is a high-level programming language supporting procedural, object-orientated and meta-programming paradigms, with a syntax compatible to Microsoft QuickBASIC. In fact, the FreeBASIC project originally began as an attempt to create a code-compatible, free alternative to Microsoft QuickBASIC, but it has since grown into a powerful development tool. FreeBASIC can be seen to extend the capabilities of Microsoft QuickBASIC in a number of ways, supporting more data types, language constructs, programming styles, and modern platforms and APIs.

Most Important Features

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. 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; On Error and Gosub supported.

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.

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 External Libraries TOC for a complete up-to-date list.

Multi-platform

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.

Unicode support

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

A large number of built-in data types

  • 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.

User-defined types (UDTs)

Unlimited nesting. BASIC's Type statement is supported, along with the new Union statement (including anonymous nested unions). Array fields utilizing up to eight dimensions can be used. Procedure pointer fields. Bit fields. Enumerations (enums) Easily declare a list of constants with sequential values with Enum. 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 Redim using the new Preserve specifier. 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. Variable, object and array initialization For static, module-level or local variables, arrays and UDT's.

Default procedure parameter values

For numeric, string and UDT parameter types. Procedure overloading Including procedures with default parameter values.

In-line assembly Intel syntax

Reference variables directly by name; no "trick code" needed.

Traditional preprocessor support

Same syntax as in C. Single-line macros supported with the #Define command, including parameters. Multi-line macros supported with the #Macro command. Type aliases Supporting forward referencing as in C, including UDT and procedure pointer types. C-like escape sequences for string literals Same as in C (except numbers are interpreted as decimal, not octal).

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

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). As a 32-bit application FreeBASIC can compile source code files up to 2 GB in size. The number of symbols (variables, constants, et cetera) is only limited by the total memory available during compile time. (You can, for example, include OpenGL, GTK/SDL, BASS, simultaneously in your source code.)

Optimized code generation

While FreeBASIC is not an optimizing compiler, it does many kinds of general optimizations to generate the fastest possible code on x86 CPU's, not losing to other BASIC alternatives, including the commercial ones. 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, archiver, and other command-line applications come from the GNU binutils programming tools.

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
Post article RSS Related Articles

🔥 Exciting News! 🔥

Toad On Fire

🔥 We're thrilled to announce that the FREE demo version of our sizzling game is now live! 🎮✨

Get ready to embark on a fiery adventure with our fearless toad hero. 🚀 Test your skills, explore captivating levels, and experience the thrill of the flames in this exclusive sneak peek into the Toad On Fire world. 🌟

🔥 What to Expect:

  • A taste of the intense gameplay that awaits you.
  • Sneak peeks into the vibrant and dynamic Toad On Fire universe.
  • Dive into the action with several complete levels, each designed to challenge and captivate you.

vlcsnap 2022 01 08 14h06m58s505

Ready to join the Toad On Fire revolution? 🔥🐸 Download the demo now and let the fiery fun begin! 🔥🚀

ToadOnFire Demo 1.3.4.1 (Windows)


Steam Page Up | First Trailer
Larry the Dinosaur 2: Something in the Cola

Steam Page Up | First Trailer

Larry the Dinosaur 2: Something in the Cola

The Steam store page for Larry the Dinosaur 2 is up! It's "coming soon", but you can add it to your wishlist. Along with this, the first trailer is released...

Buy Toad On Fire on Steam
Toad On Fire

Buy Toad On Fire on Steam

Toad On Fire

Toad On Fire is a top-down, retro-like action-adventure shooter. You play as Smokey, a toad armed with a flamethrower, and take the offensive against...

Release Trailer and New Screenshots
Toad On Fire

Release Trailer and New Screenshots

Toad On Fire

I edited a new trailer and took some new screenshots. Come see the pretty colors and action. Oh, and the game is released!

Coding Session - 10/16/2020
Toad On Fire

Coding Session - 10/16/2020

Toad On Fire

In this video, I work on what happens when you barrel off into the waters. And I troubleshoot a bug with the heat bar.

Add game Games
Larry the Dinosaur 2: Something in the Cola

Larry the Dinosaur 2: Something in the Cola

Platformer

Dive into survival horror with Larry the Dinosaur 2! Trapped in a dark office tower overrun by aliens, solve puzzles, confront creatures, and uncover...

Toad On Fire

Toad On Fire

Adventure

Smokey the toad is not your average amphibian. With a propane-fueled weed burner in hand, he charges into battle against a relentless force of hostile...

Catloaf 2600

Catloaf 2600

Roguelike

Catloaf 2600 is a small, minimalist, retro-style type of game. The objective is to find your way through a labyrinth/maze by finding keys to unlock doors...

The Empire of Cosmos

The Empire of Cosmos

Real Time Strategy

The Empire of Cosmos ist ein Weltraum Echtzeitstrategie Spiel das noch in den Kinderschuhen steckt...

Post comment Comments
rexxitall
rexxitall - - 1 comments

Freebasic compiles meanwhile (2021) also on Windows 64 bit as on Arm Platforms. I use it sometimes in UBUNTU MATE ARM64 on as Raspi 4 :) And yes it makes even on that tiny guy a lot of fun as well. Also not to forget to mention. Meanwhile FB also can use and create COM Components in in Windows.
Meanwhile we have also nice debugging features.
Maybee give this IDE a chance. 64 bit and 64bit debugging as well as GUI Form creation Github.com

Reply Good karma Bad karma+1 vote
Guest
Guest - - 689,409 comments

Wow, that trailer looks amazing. Though I don't know anything about programming.

Reply Good karma Bad karma+1 vote
Guest
Guest - - 689,409 comments

This comment is currently awaiting admin approval, join now to view.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

X