HOME

TheInfoList



OR:

PowerBASIC, formerly Turbo Basic, is the brand of several commercial
compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
s by PowerBASIC Inc. that compile a dialect of the
BASIC Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * Basic (film), ''Basic'' (film), a 2003 film ...
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
. There are both
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
and
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
versions, and two kinds of the latter: Console and Windows. The MS-DOS version has a syntax similar to that of
QBasic QBasic is an integrated development environment (IDE) and BASIC interpreter, interpreter for a variety of dialects of BASIC which are based on QuickBASIC. Code entered into the IDE is compiled into an intermediate representation (IR), and this ...
and
QuickBASIC Microsoft QuickBASIC (also QB) is an Integrated Development Environment (or IDE) and compiler for the BASIC programming language that was developed by Microsoft. QuickBASIC runs mainly on DOS, though there was also a short-lived version for the c ...
. 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 The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running. Programs can acces ...
.


History

The first version of the DOS compiler was published as BASIC/Z, the very first interactive compiler for
CP/M CP/M, originally standing for Control Program/Monitor and later Control Program for Microcomputers, is a mass-market operating system created in 1974 for Intel 8080/Intel 8085, 85-based microcomputers by Gary Kildall of Digital Research, Dig ...
and MDOS. Later it was extended to MS-DOS/ PC DOS and in 1987
Borland Borland Software Corporation was a computing technology company founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad, and Philippe Kahn. Its main business was developing and selling software development and software deployment products. B ...
distributed it as ''Turbo Basic''. ''Turbo Basic'' was originally created by Robert "Bob" Zale (1945–2012) and bought from him by
Borland Borland Software Corporation was a computing technology company founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad, and Philippe Kahn. Its main business was developing and selling software development and software deployment products. B ...
. 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. 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. 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 the PowerBASIC
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
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 Software testing is the act of checking whether software satisfies expectations. Software testing can provide objective, independent information about the quality of software and the risk of its failure to a user or sponsor. Software test ...
, and
64-bit In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit central processing units (CPU) and arithmetic logic units (ALU) are those that are based on processor registers, a ...
compilers and PB/Pro (PBWin and CC in one compiler) were in the
alpha stage The software release life cycle is the process of developing, testing, and distributing a software product (e.g., an operating system). It typically consists of several stages, such as pre-alpha, alpha, beta, and release candidate, before the fi ...
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 16-bit microcomputers are microcomputers that use 16-bit microprocessors. A 16-bit register can store 216 different values. The range of integer values that can be stored in 16 bits depends on the integer representation used. With the two ...
DOS MZ executable files, while PBWIN and PBCC create
32-bit In computer architecture, 32-bit computing refers to computer systems with a processor, memory, and other major system components that operate on data in a maximum of 32- bit units. Compared to smaller bit widths, 32-bit computers can perform la ...
Portable Executable The Portable Executable (PE) format is a file format for executables, object file, object code, Dynamic-link library, dynamic-link-libraries (DLLs), and binary files used on 32-bit and 64-bit Microsoft Windows, Windows operating systems, as well ...
(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 In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
which generated native code for MS-DOS. Other implementations were either interpreters, or relied heavily on a
runtime library A runtime library is a library that provides access to the runtime environment that is available to a computer program tailored to the host platform. A runtime environment implements the execution model as required for a development environme ...
. The integrated development environment could run a BASIC program internally for traditional BASIC debugging (see sample below), or generate an MS-DOS stand-alone
executable file In computer science, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instructions", as opposed to a da ...
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 ALGOL (; short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the ...
-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 Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making specific disciplined use of the structured control flow constructs of selection ( if/then/else) and repet ...
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(q$) = 0 q$ = LCASE$(LEFT$(q$, 1)) LOOP WHILE q$ = "y" PRINT "Goodbye "; n$ (s$ is a
string String or strings may refer to: *String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects Arts, entertainment, and media Films * ''Strings'' (1991 film), a Canadian anim ...
and s is a 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 An integrated development environment (IDE) is a Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
(IDE) and supports DOS 3.30 and all later versions.


PowerBASIC Console Compiler (PBCC)

PBCC is a 32-bit compiler for the
Windows 9x Windows 9x is a generic term referring to a line of discontinued Microsoft Windows operating systems released from 1995 to 2000 and supported until 2006, which were based on the kernel introduced in Windows 95 and modified in succeeding version ...
series and
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
series of
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s, including
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
, Windows Server 2008,
Windows Vista Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
, and
Windows 7 Windows 7 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on July 22, 2009, and became generally available on October 22, ...
. PBCC applications can use dynamic-link libraries (DLLs). The compiler comes with an IDE including an editor and stepping
debugger A debugger is a computer program used to test and debug other programs (the "target" programs). Common features of debuggers include the ability to run or halt the target program using breakpoints, step through code line by line, and display ...
. 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 file:Common Gateway Interface logo.svg, The official CGI logo from the spec announcement In computing, Common Gateway Interface (CGI) is an interface specification that enables web servers to execute an external program to process HTTP or HTTPS ...
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 Windows 9x is a generic term referring to a line of discontinued Microsoft Windows operating systems released from 1995 to 2000 and supported until 2006, which were based on the kernel introduced in Windows 95 and modified in succeeding version ...
series and the
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
series of operating systems, including
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
, Windows Server 2008,
Windows Vista Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
,
Windows 7 Windows 7 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on July 22, 2009, and became generally available on October 22, ...
,
Windows 8 Windows 8 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on August 1, 2012, made available for download via Microsoft ...
( 8.1),
Windows 10 Windows 10 is a major release of Microsoft's Windows NT operating system. The successor to Windows 8.1, it was Software release cycle#Release to manufacturing (RTM), released to manufacturing on July 15, 2015, and later to retail on July 2 ...
and
Windows 11 Windows 11 is a version of Microsoft's Windows NT operating system, released on October 5, 2021, as the successor to Windows 10 (2015). It is available as a free upgrade for devices running Windows 10 that meet the #System requirements, Windo ...
PBWin can create dynamic-link libraries. PBWin applications can read dynamic-link libraries]. PBWin comes with a compiler, IDE with editor, and stepping
debugger A debugger is a computer program used to test and debug other programs (the "target" programs). Common features of debuggers include the ability to run or halt the target program using breakpoints, step through code line by line, and display ...
.


Dynamic Dialog Tools (DDT)

You can create an application's
graphical user interface A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
using the
Windows API The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running. Programs can acces ...
, or by using the built-in DDT language extensions. The group of BASIC statements which wrap
Windows API The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running. Programs can acces ...
functions, particularly in the creation and handling of
dialog box In computing, a dialog box (also simply dialog) is a graphical control element in the form of a small window that communicates information to the user and prompts them for a response. Dialog boxes are classified as " modal" or "modeless", dep ...
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 The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running. Programs can acces ...
. 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).


Tools


PB Forms

PowerBASIC Forms, available for purchase separately, is a
graphical user interface A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
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 (PBWin & PBCC) support almost all of the
x86 instruction set The x86 instruction set refers to the set of instructions that x86-compatible microprocessors support. The instructions are usually part of an executable program, often stored as a computer file and executed on the processor. The x86 instructi ...
, including FPU,
SIMD Single instruction, multiple data (SIMD) is a type of parallel computer, parallel processing in Flynn's taxonomy. SIMD describes computers with multiple processing elements that perform the same operation on multiple data points simultaneousl ...
, and MMX, the main exceptions being a few which are useful mostly to systems programmers. One can insert any unsupported instructions by inserting their
opcode In computing, an opcode (abbreviated from operation code) is an enumerated value that specifies the operation to be performed. Opcodes are employed in hardware devices such as arithmetic logic units (ALUs), central processing units (CPUs), and ...
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 is used to give a very small example of the
syntax In linguistics, syntax ( ) is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure (constituenc ...
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 (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 Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impl ...
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 The Graphics Device Interface (GDI) is a legacy component of Microsoft Windows responsible for representing graphical objects and transmitting them to output devices such as monitors and printers. It was superseded by DirectDraw API and later ...
(GDI) 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.


=Creating a GRAPHIC WINDOW application

= A GRAPHIC WINDOW is the equivalent of a Windows
dialog box In computing, a dialog box (also simply dialog) is a graphical control element in the form of a small window that communicates information to the user and prompts them for a response. Dialog boxes are classified as " modal" or "modeless", dep ...
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 WNDPROC for the GRAPHIC WINDOW. A short source code example for a complete GRAPHIC WINDOW application follows: #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


=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 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 DCs 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 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. 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. 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>


References


External links

* PowerBASIC company website
PowerBASIC Peer Support Community

Börje Hagsten's Files





FreeBase's Page on PowerBASIC
(archived 2014)
TheirCorp's PowerBASIC projects on SourceForge

PowerBASIC for Beginners YouTube channel

Borland Turbo Basic 1.x - Stats, Downloads and Screenshots :: WinWorld - Abandonware and Pre-Release Software
* Books on
Internet Archive The Internet Archive is an American 501(c)(3) organization, non-profit organization founded in 1996 by Brewster Kahle that runs a digital library website, archive.org. It provides free access to collections of digitized media including web ...
: *
Using Turbo Basic
Frederick E. Mosher & David I. Schneider. *
Borland Turbo BASIC Owners Handbook
1987. Borland.


Third-party support


Computer Workshop (EZGUI)

Theo's Forum: José Roca Software
(archived 2011-07-26)
PlanetSquires Forums
!-- find archive! --> {{BASIC BASIC compilers BASIC programming language family Borland software DOS software Articles with example BASIC code