QB64
Encyclopedia
QB64 is a self-hosting
Self-hosting
The term self-hosting was coined to refer to the use of a computer program as part of the toolchain or operating system that produces new versions of that same program—for example, a compiler that can compile its own source code. Self-hosting software is commonplace on personal computers and larger...

 BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

 compiler for Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 and MacOSX, designed to be compatible with Microsoft QBasic
QBasic
QBasic is an IDE and interpreter for a variant of the BASIC programming language which is based on QuickBASIC. Code entered into the IDE is compiled to an intermediate form, and this intermediate form is immediately interpreted on demand within the IDE. It can run under nearly all versions of DOS...

 and QuickBASIC
QuickBASIC
Microsoft QuickBASIC is an Integrated Development Environment and compiler for the BASIC programming language that was developed by Microsoft. QuickBASIC runs mainly on DOS, though there was a short-lived version for Mac OS...

. QB64 is a C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

 emitter, which is integrated with a C++ compiler to provide compilation via C++ code and GCC
GNU Compiler Collection
The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain...

 optimization.

QB64 implements most QBasic statements, and can run many QBasic programs, including Microsoft's QBasic Gorillas and Nibbles
Nibbles (computer game)
Nibbles is a simple video game and variant of Snake. It was inspired by an early 1980's game called Hustle from the Radio Shack TRS-80 micro-computer....

 games. Furthermore, QB64 has been designed to contain an IDE resembling the QBASIC IDE. QB64 also extends the QBASIC programming language to include 64-bit
64-bit
64-bit is a word size that defines certain classes of computer architecture, buses, memory and CPUs, and by extension the software that runs on them. 64-bit CPUs have existed in supercomputers since the 1970s and in RISC-based workstations and servers since the early 1990s...

 data types, as well as better sound and graphics support.

History

QB64 was originally compiled with QuickBASIC 4.5. After significant development, Galleon, the developer, became hindered by QuickBASIC's memory limitations and switched to Microsoft Basic PDS 7.1, which solved these problems for a short time. After version 0.63, QB64 was able to compile itself so the Conventional memory
Conventional memory
In DOS memory management, conventional memory, also called base memory, is the first 640 kilobytes of the memory on IBM PC or compatible systems. It is the read-write memory usable by the operating system and application programs...

 limitations no longer applied.

Syntax

QB64's syntax is designed to be completely backwards compatible with QuickBASIC. Line number
Line number
In computing, a line number is a method used to specify a particular sequence of characters in a text file. The most common method of assigning numbers to lines is to assign every line a unique number, starting at 1 for the first line, and incrementing by 1 for each successive line.In the C...

s are not required, and statements are terminated by newline
Newline
In computing, a newline, also known as a line break or end-of-line marker, is a special character or sequence of characters signifying the end of a line of text. The name comes from the fact that the next character after the newline will appear on a new line—that is, on the next line below the...

s or by colon
Colon (punctuation)
The colon is a punctuation mark consisting of two equally sized dots centered on the same vertical line.-Usage:A colon informs the reader that what follows the mark proves, explains, or lists elements of what preceded the mark....

s (:). As in QuickBASIC, bitwise
Bitwise operation
A bitwise operation operates on one or more bit patterns or binary numerals at the level of their individual bits. This is used directly at the digital hardware level as well as in microcode, machine code and certain kinds of high level languages...

 and logical operations are combined, and true is represented by negative one.

An example Hello, World program is:


10 PRINT "Hello, World!"

Extensions to QBASIC

QB64's extended commands begin with an underscore
Underscore
The underscore [ _ ] is a character that originally appeared on the typewriter and was primarily used to underline words...

 in order to avoid conflicts with any names that may be used in a QuickBASIC program.
QB64 extends the QuickBASIC language in several ways. It adds the new data type
Data type
In computer programming, a data type is a classification identifying one of various types of data, such as floating-point, integer, or Boolean, that determines the possible values for that type; the operations that can be done on values of that type; the meaning of the data; and the way values of...

s including _BIT, _BYTE, _INTEGER64 and _FLOAT as well as unsigned
Signedness
In computing, signedness is a property of data types representing numbers in computer programs. A numeric variable is signed if it can represent both positive and negative numbers, and unsigned if it can only represent non-negative numbers .As signed numbers can represent negative numbers, they...

 data types. The new data types have suffixes
Sigil (computer programming)
In computer programming, a sigil is a symbol attached to a variable name, showing the variable's datatype or scope. In 1999 Philip Gwyn adopted the term "to mean the funny character at the front of a Perl variable".- Historical context:...

 just like the traditional BASIC data types. QB64 also includes an audio library which allows playing most common audio formats including MP3
MP3
MPEG-1 or MPEG-2 Audio Layer III, more commonly referred to as MP3, is a patented digital audio encoding format using a form of lossy data compression...

, Ogg Vorbis, and MIDI files as well as libraries allowing users to use higher resolution graphics than the 640×480 offered by QuickBASIC, use different fonts, and plot images in BMP, PNG, and JPEG
JPEG
In computing, JPEG . The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality....

 format. It also allows the use of 32-bit colors as opposed to the limited 256 (or 16, depending) colors originally offered.
The programmer also does not have to specify which programming libraries to include since QB64 does it automatically. However, work is being done to make QB64 more intelligent as to which libraries to include since at the moment it includes all of them. The programmer has the option to include a library of their own through the $INCLUDE command just as QuickBasic
QuickBASIC
Microsoft QuickBASIC is an Integrated Development Environment and compiler for the BASIC programming language that was developed by Microsoft. QuickBASIC runs mainly on DOS, though there was a short-lived version for Mac OS...

 did.

Libraries

QB64 currently uses the SDL
Simple DirectMedia Layer
Simple DirectMedia Layer is a cross-platform, free and open source multimedia library written in C that presents a simple interface to various platforms' graphics, sound, and input devices....

library for both graphics and text modes.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK