Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
PowerBASIC
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Software compiler}} {{Redirect|Turbo Basic|the Basic Dialect for the Atari 8-bit series of computers|Turbo-Basic XL}} {{Infobox programming language | name = PowerBASIC | screenshot = PowerBasic-screen-shot.png | screenshot caption = Screenshot of PowerBASIC for Windows 9.0 IDE and an example compiled Windows GUI. | released = {{Start date and age|1989}} | developer = Robert "Bob" Zale (b. 1945, d. 2012) | latest_release_version = 10.0 ({{Start date and age|df=yes|2011|05|04}})<ref>[https://www.powerbasic.com/support/pbforums/showthread.php?t=047454 Release of PowerBASIC 10.0 Compiler for Windows]</ref> | influenced by = [[Turbo Basic]] | operating system = [[Microsoft Windows|Windows]] (32-bit only), [[MS-DOS]] | website = {{URL|https://www.powerbasic.com/}} }} '''PowerBASIC''', formerly '''Turbo Basic''', is the brand of several commercial [[compiler]]s by PowerBASIC Inc. that compile a dialect of the [[BASIC]] [[programming language]]. There are both [[MS-DOS]] and [[Microsoft Windows|Windows]] versions, and two kinds of the latter: Console and Windows. The MS-DOS version has a syntax similar to that of [[QBasic]] and [[QuickBASIC]]. The Windows versions use a BASIC syntax expanded to include many Windows functions, and the statements can be combined with calls to the [[Windows API]]. ==History== The first version of the DOS compiler was published as BASIC/Z, the very first interactive compiler for [[CP/M]] and MDOS. Later it was extended to MS-DOS/[[PC DOS]] and in 1987 [[Borland]] distributed it as ''Turbo Basic''. <!-- [[WP:NFCC]] violation: [[File:Turbobasic11 00.png|thumb|Turbo Basic 1.1 (1987) startup screen.]] -->''Turbo Basic'' was originally created by Robert "Bob" Zale (1945–2012) and bought from him by [[Borland]]. When Borland decided to stop publishing it (1989), Zale bought it back from them, renamed it '''PowerBASIC''' and set up PowerBASIC Inc. to continue support and development of it; it was later called PBDOS.<ref>{{cite news |title=PowerBASIC makes smooth move; Tech company finds region's affordability attractive. |date=2000-10-10 |publisher=Sarasota Herald Tribune |url=http://www.accessmylibrary.com/coms2/summary_0286-28422911_ITM |access-date=2008-03-12}}</ref><ref>{{cite book |last=Tooley |first=Michael H. |year=2005 |title=PC Based Instrumentation and Control |publisher=Elsevier |page=[https://archive.org/details/pcbasedinstrumen00bami_789/page/n230 214] |isbn=0-7506-4716-7 |url=https://archive.org/details/pcbasedinstrumen00bami_789 |url-access=limited}}</ref><ref>{{cite web |title=An Introduction to PowerBASIC |url=https://www.powerbasic.com/aboutpb.asp |access-date=2010-12-07 |url-status=dead |archive-url=https://web.archive.org/web/20110527060333/https://www.powerbasic.com/aboutpb.asp |archive-date=2011-05-27}}</ref> PowerBASIC went on to develop BASIC compilers for Windows, first PBWIN — their flagship product — and then PBCC, described below. On November 6, 2012, Robert Zale, the creator of PowerBASIC, died. For a time, it was assumed that the company might cease operations. His wife, Vivian Zale, posted on 8 March 2014 to the PowerBASIC forums a statement that the company would continue in operation.<ref>{{cite web |last=Zale |first=Vivian |title=PowerBASIC Update |website=PowerBASIC Peer Support Community |date=8 March 2014 |url=https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-for-windows/55913-powerbasic-update}}</ref> On May 10, 2015, Vivian Zale announced that work was continuing on new versions of PowerBASIC compilers.<ref>{{cite web |last=Eccles |first=John |title=PowerBASIC Plans |website=PowerBASIC Forums |publisher=PowerBASIC, Inc. |url=https://www.powerbasic.com/support/pbforums/showthread.php?t=59383 |access-date=5 July 2015 |url-status=dead |archive-url=https://web.archive.org/web/20150924080657/https://www.powerbasic.com/support/pbforums/showthread.php?t=59383 |archive-date=24 September 2015}}</ref> On November 2, 2016, Vivian Zale announced her intention to seek a buyer for the company. On January 31, 2017, Adam Drake announced Drake Software had acquired the PowerBASIC [[source code]] from PowerBASIC, Inc., with the intention of updating and improving the functionality of the product.<ref>{{cite web |title=PowerBASIC Has a New Home |last=Drake |first=Adam |date=January 31, 2017 |website=PowerBASIC Peer Support Community |url=https://forum.powerbasic.com/forum/announcements-articles-and-support-faqs/product-announcements/757277-powerbasic-has-a-new-home |url-status=dead |archive-url=https://web.archive.org/web/20170219030059/https://forum.powerbasic.com/forum/announcements-articles-and-support-faqs/product-announcements/757277-powerbasic-has-a-new-home |archive-date=2017-02-19}}</ref> This was later confirmed by Vivian Zale with a forum post thanking the members for their support.<ref>{{cite web |title=Thank You |last=Zale |first=Vivian |date=February 12, 2017 |website=PowerBASIC Peer Support Community |url=https://forum.powerbasic.com/forum/announcements-articles-and-support-faqs/product-announcements/757991-thank-you |url-status=dead |archive-url=https://web.archive.org/web/20170219013011/https://forum.powerbasic.com/forum/announcements-articles-and-support-faqs/product-announcements/757991-thank-you |archive-date=2017-02-19}}</ref> When Bob Zale died, PBWin11 and PBCC7 were in [[beta testing]], and [[64-bit]] compilers and PB/Pro (PBWin and CC in one compiler) were in the [[alpha stage]]s. However, development of PowerBASIC products has stopped. No new version has been released since v10.03 (13 years ago as of May 2024). No 64-bit version or beta release has been announced. No development activity has been reported. No corrections (such as adding the correct DPI settings for the IDE) have been released. PowerBASIC Tools LLC still sells new licenses for the 32-bit Windows compilers. ==Compilers== PowerBASIC programs are self-contained and use no runtime file to execute. In all versions of the compiler, the applications compile without external libraries, though it can use such libraries if needed. PBDOS creates [[16-bit]] [[DOS MZ executable]] files, while PBWIN and PBCC create [[32-bit]] [[Portable Executable]] (PE) files. ===Turbo Basic=== Borland's Turbo Basic contains extensions to classic BASIC (without breaking compatibility), such as a drawing API and mouse access. Unlike most BASIC implementations of its time, Turbo Basic was a full [[compiler]] which generated native code for MS-DOS. Other implementations were either [[BASIC interpreter|interpreters]], or relied heavily on a [[runtime library]]. The integrated development environment could run a BASIC program internally for traditional BASIC debugging (see sample below), or generate an MS-DOS stand-alone [[.exe|executable file]] that could be run on other systems without the Turbo Basic product or runtime libraries. ====Code example==== <!-- Deleted image removed: [[File:Turbobasic11 01.png|thumb|Turbo Basic 1.1 editing the example code, in the zoomed editor window.]] --><!-- Deleted image removed: [[File:Turbobasic11 02.png|thumb|Turbo Basic 1.1 running the example in the multiple-window IDE.]] --> The following program is an example of the [[ALGOL]]-like BASIC dialect that Turbo Basic supported. Unlike traditional BASIC,{{citation needed|date=February 2018}} which used line numbers and had limited control structures and no support for ALGOL-like subroutines, modern BASIC dialects starting at this period were extended to make the language compatible with modern [[structured programming]] style by making line numbers optional and adding the control structures and subroutine definitions needed for structured programming. <syntaxhighlight lang="qbasic"> INPUT "What is your name?: ", n$ PRINT "Hello "; n$ DO s$ = "" INPUT "How many stars do you want to print"; s FOR i = 1 TO s s$ = s$ + "*" NEXT i PRINT s$ DO INPUT "Do you want to print more stars"; q$ LOOP WHILE LEN(q$) = 0 q$ = LCASE$(LEFT$(q$, 1)) LOOP WHILE q$ = "y" PRINT "Goodbye "; n$ </syntaxhighlight> (<code>s$</code> is a [[string (computer science)|string]] and <code>s</code> is a [[single-precision floating-point format|single-precision floating-point]] (number). They are separate variables.) Like the other Borland products of this era, the code executes within the integrated development environment. ===PowerBASIC for DOS (PBDos)=== PBDOS includes an [[integrated development environment]] (IDE) and supports [[DOS]] 3.30 and all later versions.<ref>{{cite web |title=PowerBASIC 3.5 for DOS |website=PowerBASIC |url=https://www.powerbasic.com/products/pbdos/ |url-status=dead |archive-url=https://web.archive.org/web/20160117225331/https://www.powerbasic.com/products/pbdos/ |archive-date=2016-01-17}}</ref> ===PowerBASIC Console Compiler (PBCC)=== <!-- [[PowerBASIC Console Compiler]] redirects here (to make the PBCC disambiguation work) --> PBCC is a 32-bit compiler for the [[Windows 9x]] series and [[Windows NT]] series of [[operating system]]s, including [[Windows XP]], [[Windows Server 2008]], [[Windows Vista]], and [[Windows 7]]. PBCC applications can use [[dynamic-link library|dynamic-link libraries]] (DLLs). The compiler comes with an [[integrated development environment|IDE]] including an editor and stepping [[debugger]]. No knowledge of Windows programming is required to create character mode or graphical applications with this compiler. PBCC-compiled executables can also be used as [[Common Gateway Interface]] executables (for web servers). PBCC creates only executables, not DLLs. (PBWin — see below — can create both.) ===PowerBASIC Compiler for Windows (PBWin)=== PBWin is a 32-bit compiler compatible with the [[Windows 9x]] series and the [[Windows NT]] series of operating systems, including [[Windows XP]], [[Windows Server 2008]], [[Windows Vista]], [[Windows 7]], [[Windows 8]] ([[Windows 8.1|8.1]]), [[Windows 10]] and [[Windows 11]]<ref>{{cite web |title=PowerBASIC Compiler for Windows |website=PowerBASIC |url=https://www.powerbasic.com/products/pbdll32/ |url-status=dead |archive-url=https://web.archive.org/web/20080308053722/https://www.powerbasic.com/products/pbdll32/ |archive-date=2008-03-08}}</ref> PBWin can create [[dynamic-link library|dynamic-link libraries]]. PBWin applications can read dynamic-link libraries]. PBWin comes with a compiler, [[integrated development environment|IDE]] with editor, and stepping [[debugger]]. ====Dynamic Dialog Tools (DDT)==== You can create an application's [[graphical user interface]] using the [[Windows API]], or by using the built-in DDT language extensions. The group of BASIC statements which wrap [[Windows API]] functions, particularly in the creation and handling of [[dialog box]]es and child controls, is collectively known as Dynamic Dialog Tools. Using DDT requires less coding than to create a similar program using the [[Windows API]]. Using the DDT and the Windows API (known as SDK style as in [[Microsoft Windows SDK]]) are not mutually exclusive. ====Trial versions of compilers==== PowerBASIC renamed PBWin v9.07 and PB/CC v5.07 as "Classic PBWin" and "Classic PB/CC", respectively, and on November 1, 2016, offered them for a short time through their online store as free, no-nag, trial versions along with PBForms v1.0 (PowerBASIC Forms).<ref>PowerBASIC 9 for Windows and PowerBASIC Console Compiler 5: [https://web.archive.org/web/20161005022613/http://shop.powerbasic.com/pages/powerbasic-product-catalog $99 and $89 on 2016-10-05]; [https://web.archive.org/web/20161106163339/http://shop.powerbasic.com/pages/powerbasic-product-catalog $0 and $0 on 2016-11-06]; [https://web.archive.org/web/20161218181204/http://shop.powerbasic.com/pages/powerbasic-product-catalog $0 and $0 on 2016-12-18]; [https://web.archive.org/web/20170228152624/http://shop.powerbasic.com/pages/powerbasic-product-catalog not offered on 2017-02-28].</ref> ==Tools== ===PB Forms=== PowerBASIC Forms, available for purchase separately, is a [[graphical user interface]] design tool add-on for PBWin. It automatically produces source code using the DDT language extension that creates forms using the Windows graphical user interface. ===COM Browser=== The PowerBASIC COM Browser, which comes with PBWin, is an application that exposes the interfaces, methods, and properties of COM objects, as described by type-library files. The PowerBASIC COM Browser exports an interface structure of a COM object for early-binding purposes in PowerBASIC code, and gives syntax reference and context-help on the interface members exposed by a COM object.<ref>{{cite web |title=Com Browser on PowerBASIC's website |url=https://www.powerbasic.com/support/help/pbcc/index.htm#the_powerbasic_com_browser.htm}}</ref> ==Programming language== ===Characteristics=== PowerBASIC is a native-code BASIC compiler whose reported merits are simplicity of use and speed compared to other languages.<ref>''New geometries for new materials'', Eric A. Lord, Alan Lindsay Mackay, Srinivasa Ranganathan, Cambridge University Press, 2006, {{ISBN|0-521-86104-7}} ("a very simple user interface ... speed and power of the underlying C++ ... runs extremely fast") [https://books.google.com/books?id=s22_x-O8pEoC&pg=PP3&vq=%22powerbasic%22&dq=%22powerBASIC%22&source=gbs_search_s&sig=uxOcCJGJsvTcUWasxzAaeRiDx3o Google Books]</ref><ref>''Chaos and Time-series Analysis'', Julien C. Sprott, Oxford University Press, 2003, {{ISBN|0-19-850840-9}} ("easy to learn, powerful, and as fast as any C compiler I have encountered") [https://books.google.com/books?id=SEDjdjPZ158C&pg=PR6&vq=PowerBASIC&dq=%22powerBASIC%22&source=gbs_search_s&sig=SBPpyPfT7S2V_-ixWTYrYvlEnZI Google Books]</ref> Although the compiled code is fast enough for most purposes, the compilers also support inline [[assembly language|assembler]] which can be used for hand optimization of critical routines. The Windows compilers (PBWin & PBCC) support almost all of the [[x86 instruction listings|x86 instruction set]], including [[floating-point unit|FPU]], [[Streaming SIMD Extensions|SIMD]], and [[MMX (instruction set)|MMX]], the main exceptions being a few which are useful mostly to systems programmers. One can insert any unsupported instructions by inserting their [[opcode]]s with the "db", "dw", and "dd" statements. Lines of assembler code can be freely interspersed with lines of BASIC code, although one must always consider the potential interactions between the two types of code. ===Hello world=== [["Hello, World!" program|Hello world]] is used to give a very small example of the [[syntax (programming languages)|syntax]] used by a programming language and is often the smallest possible program for any given programming language. Here is an example of a PBCC hello world program. By default PBCC creates a console window at runtime for displaying output. The use of Waitkey$ in this example prevents the console window from automatically closing until the operator sees the displayed text. <syntaxhighlight lang="vbscript"> Function PBMain Print "Hello, World!" Waitkey$ End Function </syntaxhighlight> Here is the PBWin version, which displays a Windows "dialog" message box. <syntaxhighlight lang="vbscript"> Function PBMain MsgBox "Hello, World!" End Function </syntaxhighlight> ===Structured control statements=== These structured control statements eliminate many instances that would require the use of GOTO and labels: * iterate - skips ahead to the next iteration of the loop containing it (iterate do, iterate loop, iterate for), like the [[continue statement]] in most languages * exit - sends execution to just after the loop (exit for, exit do, exit loop), conditional (exit if, exit select), or block (exit function, exit sub) containing it, like the [[break statement]] in most languages ===Object-oriented programming=== PBWin and PBCC support [[object-oriented programming]] in the form of [[Component Object Model|COM]] classes, however the compilers do not force you to use OOP, it is merely an option. In-process and out-of-process COM Servers can also be built using these compilers. ====Graphics==== Both the Console Compiler and Windows Compiler can create graphic windows. The GRAPHICs statements are higher-level than Windows' [[Graphics Device Interface]] (GDI) library functions.<ref>{{cite web |title=PowerBASIC Console Compiler |website=PowerBASIC Peer Support Community |url=https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-console-compiler}}</ref><ref>{{cite web |title=PowerBASIC for Windows |website=PowerBASIC Peer Support Community |url=https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-for-windows}}</ref> =====Elements of the GRAPHIC statements===== GRAPHIC WINDOWS are dedicated dialogs each containing a single control which fills the dialog's client area. GRAPHIC controls are [[child window]]s which support the same GRAPHIC drawing functionality as GRAPHIC windows. GRAPHIC BITMAPS are also defined, again supporting the GRAPHIC drawing functionality, but as purely memory objects, like [[BMP file format|Windows bitmaps]] or [[BMP file format|DIB sections]]. Keyboard and mouse handling statements are included among the GRAPHIC statements. Character output to a GRAPHIC target uses fonts specified via the FONT NEW statement. =====Creating a GRAPHIC WINDOW application===== A GRAPHIC WINDOW is the equivalent of a Windows [[dialog box]] containing a static control on which drawing operations can be done. A single BASIC statement will create a GRAPHIC WINDOW and specify its size, position and title. It is not essential to specify a [[Windows USER|WNDPROC]] for the GRAPHIC WINDOW. A short source code example for a complete GRAPHIC WINDOW application follows: <syntaxhighlight lang="vbnet"> #Compile Exe ' using either PBCC6 or PBWIN10 compiler #Dim All Function PBMain Local GW As Dword ' start a GRAPHIC WINDOW Graphic Window New "graphic window", 100, 100, 200, 200 to GW ' show a coloured disc Graphic Ellipse (10, 10)-(190, 190), %rgb_Red, %rgb_SeaGreen, 0 ' wait for a keypress Graphic Waitkey$ End Function </syntaxhighlight> =====Comparison of PB GRAPHIC statements with the GDI API===== Using PB GRAPHIC statements, a GRAPHIC (WINDOW, BITMAP, or control) is first selected as the current GRAPHIC target, then operations are done on it without requiring it to be identified again. Contrast this with the GDI API approach, where the [[Device Context]] handle is required for every drawing operation. It is not necessary when using the PB GRAPHIC statements to define a brush or pen as a separate entity, nor is it necessary to redraw the GRAPHIC target (when in view) in response to [[Windows USER|Windows messages]] such as WM_PAINT and WM_ERASEBKGND. GRAPHIC targets are persistent. When GRAPHIC targets are attached, a REDRAW option can be specified which buffers the results of drawing operations until they are specifically requested. Using this technique reduces flicker in a similar way to the technique of drawing on memory [[Graphics Device Interface|DC]]s <ref>Petzold, Charles (1998). Programming Windows Fifth Edition, Microsoft Press, {{ISBN|978-1-57231-995-0}}</ref> when using the GDI API. Pixel operations are possible using the GRAPHIC GET|SET PIXEL statements, in a manner similar to GetPixel/SetPixel of the GDI API. GRAPHIC GET BITS allows the entire bitmap to be loaded into a dynamic string. This can be manipulated either as a string or by mapping an array onto it. It can be placed back into the GRAPHIC target by GRAPHIC SET BITS. =====Complementarity of GRAPHIC statements and the Windows GDI API===== The GRAPHIC statements contain all the commonly used GDI API functions, but if you need one that is not included it is possible to obtain the [[Graphics Device Interface|hDC]] of any GRAPHIC target and thereby use GDI API functions on it. ==User community== PowerBASIC provides an online forum for users to ask questions and share knowledge.<ref>{{cite web |title=PowerBASIC Peer Support Community help |url=https://forum.powerbasic.com/help}}</ref> On 8 July 2012 the forum had 5,623 members (only a fraction of them still active) and contained 50,093 threads comprising 408,642 posts since August 26, 1998. The Source Code section alone contained 3,768 threads.<ref>PowerBASIC's vBulletin forum software statistics</ref> In early 2024 the main PowerBASIC website was switched to "under construction". This was heavily discussed in PB forums. The rights owner wrote that the website will not come back.<ref>[https://forum.powerbasic.com/forum/announcements-articles-and-support-faqs/frequently-asked-questions/833672-powerbasic-website-and-forums]</ref> ==References== {{Reflist}} ==External links== * {{Official website|https://www.powerbasic.com/}} PowerBASIC company website * [https://forum.powerbasic.com/ PowerBASIC Peer Support Community] * [https://www.reonis.com/POFFS/ Börje Hagsten's Files] * [http://www.greatwebdivide.com/code.htm Don Dickinson's PowerBASIC code] * [https://www.garybeene.com/sw/gbsnippets.htm Gary Beene's gbSnippets] * [https://web.archive.org/web/20140104104921/http://www.freebase.com/en/powerbasic FreeBase's Page on PowerBASIC] (archived 2014) * [https://sourceforge.net/projects/ideatester/ TheirCorp's PowerBASIC projects on SourceForge] * [https://www.youtube.com/channel/UCpPrE3YAKOhN1_B30pvlPdA PowerBASIC for Beginners YouTube channel] * [https://winworldpc.com/product/turbo-basic/1x Borland Turbo Basic 1.x - Stats, Downloads and Screenshots :: WinWorld - Abandonware and Pre-Release Software] * Books on [[Internet Archive]]: ** [https://archive.org/details/UsingTurboBasic Using Turbo Basic] Frederick E. Mosher & David I. Schneider. ** [https://archive.org/details/bitsavers_borlandBorsHandbook1987_15768512 Borland Turbo BASIC Owners Handbook] 1987. Borland. ===Third-party support=== * [https://cwsof.com/ Computer Workshop (EZGUI)] * [https://web.archive.org/web/20110726194812/http://www.jose.it-berater.org/smfforum/ Theo's Forum: José Roca Software] (archived 2011-07-26) * [https://www.planetsquires.com/protect/forum/ PlanetSquires Forums]<!-- find archive! --> {{BASIC}} [[Category:BASIC compilers]] [[Category:BASIC programming language family]] [[Category:Borland software]] [[Category:DOS software]] [[Category:Articles with example BASIC code]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:BASIC
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite news
(
edit
)
Template:Cite web
(
edit
)
Template:ISBN
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Official website
(
edit
)
Template:Redirect
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)