Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

QB64

From Wikipedia, the free encyclopedia
IDE for the BASIC programming language
QB64
The QB64 logo
DeveloperRob Galleon, QB64Team
First appearedSeptember 8, 2007; 17 years ago (2007-09-08)
Stable release
2.0.2 / November 7, 2021; 3 years ago (2021-11-07)
OSMicrosoft Windows,Linux,macOS
LicenseMIT
Websitewww.qb64.com
Influenced by
QuickBASIC,QBASIC

QB64 (originallyQB32)[1] is aself-hostingBASIC compiler forMicrosoft Windows,Linux andMac OS X, designed to be compatible with MicrosoftQBasic andQuickBASIC. QB64 is atranspiler toC++, which is integrated with a C++ compiler to provide compilation via C++ code andGCC optimization.[2]

QB64 implements most QBasic statements, and can run many QBasic programs, including Microsoft's QBasicGorillas andNibbles games.[3] Furthermore, QB64 has been designed to contain an IDE resembling the QBASIC IDE. QB64 also extends the QBASIC programming language to include64-bit data types, as well as better sound and graphics support. It can also emulate some DOS/x86 specific features such asINT 33h mouse access, and multiple timers.

Since version 2.0, QB64 now offers debugging abilities, with the new$DEBUG metacommand.[4]

History

[edit]

QB64 was originally compiled with QuickBASIC 4.5. After significant development, Rob 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.[5] After version 0.63, QB64 wasable to compile itself so theconventional memory limitations no longer applied.

Regarding the impetus for QB64, Galleon said:[6]

I began to see the need for QB64 when it was clear that the introduction ofVISTA would cripple QBASIC, relegating it to an ancient language only runnable on emulators which allow little/no chance of taking advantage of modern features on computers. The actual coding of QB64 began at the beginning of this year and QB64 has made steady progress since. I have had experience writing programming languages before so I knew in advance the challenges that awaited.

Starting in 2016, work began on agraphical user interface builder andevent drivenintegrated development environment called InForm, giving features similar toVisual Basic.[7]

Syntax

[edit]

QB64's syntax is designed to be completely backwards compatible with QuickBASIC.Line numbers are not required, and statements are terminated bynewlines or separated bycolons (:).

An example"Hello, World!" program is:

PRINT"Hello, World!"

An example of QB64's emulation of VGA memory for compatibility:

CLSS$="Hello, World!"DEF SEG=&HB800'sets the segment to video memoryFORI=1TOLEN(S$)POKE160+(I-1)*2,ASC(MID$(S$,I,1))'characterNEXTDEF SEG'reset the segment to default

An example of how QB64 allows audio files:

sound_effect&=_SNDOPEN("sound.wav")'WAV, OGG or MP3_SNDPLAYsound_effect&

An example of how QB64 allows picture files:

SCREEN_NEWIMAGE(800,600,32)'creates a 32-bit screenimagename&=_LOADIMAGE("image__name.png")'BMP, JPG, PNG, etc._PUTIMAGE(0,0),imagename&_FREEIMAGEimagename&'release assigned memory

An example of how QB64 uses multiple timers:

t1=_FREETIMERt2=_FREETIMERON TIMER(t1,1)GOSUBTimer.Trap'the code following the Timer.Trap label will be run every 1 secondON TIMER(t2,.5)mySub'QB64 can also trigger a SUB procedure with TIMER;'                       in this case mySUB will be triggered every 500 milliseconds'activate timers:TIMER(t1)ONTIMER(t2)ONDO'go into an infinite loop until the window is closed_LIMIT1'run the main loop at 1 cycle per second, to show how timers are independent from main program flowLOOPTimer.Trap:PRINT"1s; ";RETURNSUBmySubPRINT"500ms; ";ENDSUB

Extensions to QBASIC

[edit]

QB64's extended commands begin with anunderscore in order to avoid conflicts with any names that may be used in a QuickBASIC program. Beginning with version 1.4, the underscore prefix can be dropped by using the metacommand$NOPREFIX.[8]QB64 extends the QuickBASIC language in several ways. It adds the newdata types including_BIT,_BYTE,_INTEGER64 and_FLOAT as well asunsigned data types. The new data types havesuffixes just like the traditional BASIC data types. QB64 also includes an audiolibrary which allows playing most common audio formats includingMP3,Ogg Vorbis, andWAV files as well as libraries allowing users to use higher resolution graphics than the 640×480 offered by QuickBASIC,[9] use different fonts, and plot images inBMP,PNG, andJPEG formats. 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. The programmer has the option to include a library of their own through the$INCLUDE command just asQuickBASIC did.

Another significant feature that has been added is networking. Initially this allowed the opening of a TCP/IP stream that could be read and written usingInput#/Print# instructions. This mode has its own proprietary packet encapsulation format which, whilst being easy to use with QBasic, meant that it could only be used to communicate with other QB64 programs or server backends with custom interfaces created specifically for the application. Later versions addGET# andPUT# to read and write raw bytes from the stream. This allows native implementations of standard protocols such as smtp and http.

Advantages of QB64

[edit]
  • It supports different file formats and also provides clipboard access.
  • QB64 gives instant access to 32-bit graphics files (most popular formats).
  • QB64 gives instant access to several audio formats.
  • It's supported on most modern operating systems, so that no emulation is required.

Libraries

[edit]

QB64 integratesFreeGLUT for its graphics and text.

A development branch of the repository hosted onGitHub is frequently updated with fixes and improvements, which will eventually become the next stable release. The development builds are also offered via the official website for users to beta test.

QB64 can also use DLL libraries for Windows and C++ headers with a DECLARE LIBRARY block. Users can also access C header files to run C functions.

Forks

[edit]

Due to ashakeup in the community in 2022, there are now at least two forks of the QB64 project.[10] The "QB64 Team" Github repository is no longer active, and all new development is being done in new forks:

References

[edit]
  1. ^Stephane Richard (2007-11-16)."In The News".PCOPY! Issue #50. Basic Programming. Archived fromthe original on 2009-12-21. Retrieved2008-08-17.
  2. ^E.K.Virtanen (2008-05-26)."Interview With Galleon".PCOPY! Issue #70. Basic Programming. Archived fromthe original on 2008-08-21. Retrieved2008-07-14.
  3. ^"QB64 Screenshots - QB64/QBASIC Gorillas in QB64". Archived fromthe original on 2013-05-12. Retrieved2010-07-27.
  4. ^"Changelog for v2.0 – QB64.org".www.qb64.org. Archived fromthe original on 2021-10-10.
  5. ^"More BUGS please! (Seriously)". 3 March 2008.
  6. ^"Welcome to the QB64 Forum!".THE QBASIC FORUM. 30 September 2007. Retrieved2020-01-28.
  7. ^Rogoz, Ivan (2022-04-07)."Blast from the past - QBasic 4.5".Barn Lab. Retrieved2023-09-26.QB64 comes with a WYSIWYG IDE editor called InForm which brings it closer to everyday use as a quick and dirty language for automation for Windows.
  8. ^"Changelog for v1.4 – QB64.org".www.qb64.org. Archived fromthe original on 2020-02-13.
  9. ^"QB Advisor: Screen Modes 11, 12, and 13". Microsoft Corporation. 1988. Archived fromthe original on 2009-01-05. Retrieved2008-07-25.
  10. ^Proven, Liam (2023-03-28)."Nostalgic for VB? BASIC is anything but dead".The Register. Retrieved2023-10-01.So does QB64, although the dust has yet to completely settle over a split among its developers. A community called QB64 Phoenix is actively developing a new Phoenix Edition.

External links

[edit]
Dialects of theBASIC programming language (list)
Classic
Microsoft
Texas Instruments
Hewlett-Packard
Locomotive Software
Microcomputers
Minicomputers
Time-sharing computers
Other
Extenders
Procedure-
oriented
Proprietary
Free and
open source
Withobject
extensions
Proprietary
Free and
open source
RAD
designers
Proprietary
Free and
open source
Defunct
Retrieved from "https://en.wikipedia.org/w/index.php?title=QB64&oldid=1262983606"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp