PowerBASIC


PowerBASIC, formerly Turbo Basic, was the brand of several commercial compilers by PowerBASIC Inc. that compiled a dialect of the BASIC programming language. There were both MS-DOS and Windows versions, and two kinds of the latter: Console and Windows. The MS-DOS version had a syntax similar to that of QBasic and QuickBASIC. The Windows versions used a BASIC syntax expanded to include many Windows functions, and the statements could be combined with calls to the Windows API.

History

The compiler was originally published as BASIC/Z, the first interactive compiler for CP/M and MDOS. Later it was extended to MS-DOS compatible operating systems. In 1987 Borland distributed it as Turbo Basic.
Turbo Basic was originally created by Robert "Bob" Zale and bought from him by Borland. When Borland decided to stop publishing it, Zale bought it back, renamed it PowerBASIC and set up PowerBASIC Inc. to continue its support and development; it was later called PBDOS.
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 would quickly cease operations. His wife, Vivian Zale, posted on 8 March 2014 to the PowerBASIC forums that the company would continue operations. On May 10, 2015, Vivian Zale announced that work was continuing on new versions of PowerBASIC compilers.
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 PowerBASIC source code from PowerBASIC, Inc., with the intention of updating and improving the functionality of the product. This was later confirmed by Vivian Zale with a forum post thanking the members for their support.
When Bob Zale died, PBWin11 and PBCC7 were in beta testing, and 64-bit compilers and PB/Pro were in the alpha stages. However, development of PowerBASIC products stopped. No new version has been released since v10.04. No 64-bit version or beta release has been announced. No development activity has been reported. No corrections have been released. PowerBASIC Tools LLC no longer sells new licenses for the 32-bit Windows compilers. The PowerBasic website was taken down in 2025.

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

Turbo Basic

Borland's Turbo Basic contains extensions to classic BASIC, 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 interpreters, or relied heavily on a runtime library. The integrated development environment could run a BASIC program internally for traditional BASIC debugging, or generate an MS-DOS stand-alone executable file that could be run on other systems without the Turbo Basic product or runtime libraries.

Code example

The following program is an example of the ALGOL-like BASIC dialect that Turbo Basic supported. Unlike traditional BASIC, 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.

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 = 0
q$ = LCASE$
LOOP WHILE q$ = "y"
PRINT "Goodbye "; n$

Like the other Borland products of this era, the code executes within the integrated development environment.

PowerBASIC for MS-DOS (PBDos)

PBDOS includes an integrated development environment and supports MS-DOS 3.3 and all later versions.

PowerBASIC Console Compiler (PBCC)

PBCC is a 32-bit compiler for the Windows 9x series and Windows NT series of operating systems, including Windows XP, Windows Server 2008, Windows Vista, and Windows 7. PBCC applications can use dynamic-link libraries. The compiler comes with an 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.
PBCC creates only executables, not DLLs.

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 10 and Windows 11 PBWin can create dynamic-link libraries. PBWin applications can read dynamic-link libraries]. PBWin comes with a compiler, 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 boxes 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 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.

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.

Programming language

Characteristics

PowerBASIC is a native-code BASIC compiler whose reported merits are simplicity of use and speed compared to other languages.
Although the compiled code is fast enough for most purposes, the compilers also support inline assembler which can be used for hand optimization of critical routines. The Windows compilers support almost all of the x86 instruction set, including FPU, SIMD, and MMX, the main exceptions being a few which are useful mostly to systems programmers. One can insert any unsupported instructions by inserting their opcodes 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

is used to give a very small example of the 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.

Function PBMain
Print "Hello, World!"
Waitkey$
End Function

Here is the PBWin version, which displays a Windows "dialog" message box.

Function PBMain
MsgBox "Hello, World!"
End Function

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, like the continue statement in most languages
  • exit - sends execution to just after the loop, conditional, or block containing it, like the break statement in most languages

    Object-oriented programming

PBWin and PBCC support object-oriented programming in the form of 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 library functions.
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 windows 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 Windows bitmaps or 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.