HOME

TheInfoList



OR:

PowerBASIC, formerly Turbo Basic, is the brand of several commercial
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
s by PowerBASIC Inc. that compile a dialect of the
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
. There are both MS-DOS and 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 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 Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations th ...
.


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 Borland Software Corporation was a computer technology company founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn. Its main business was the development and sale of software development and software deployment product ...
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 computer technology company founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn. Its main business was the development and sale of software development and software deployment product ...
. 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 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 (PBWin and CC in one compiler) were in the alpha stages. However, development of PowerBASIC products has stopped. No new version has been released since v10.03 (11 years ago as of May 2022). 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 The DOS MZ executable format is the executable file format used for .EXE files in DOS. The file can be identified by the ASCII string "MZ" ( hexadecimal: 4D 5A) at the beginning of the file (the " magic number"). "MZ" are the initials of Mar ...
files, while PBWIN and PBCC create 32-bit
Portable Executable The Portable Executable (PE) format is a file format for executables, object code, DLLs and others used in 32-bit and 64-bit versions of Windows operating systems. The PE format is a data structure that encapsulates the information necessary fo ...
(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 translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
which generated native code for MS-DOS. Other implementations were either
interpreters Interpreting is a translational activity in which one produces a first and final target-language output on the basis of a one-time exposure to an expression in a source language. The most common two modes of interpreting are simultaneous interp ...
, 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 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 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 extensive use of the structured control flow constructs of selection ( if/then/else) and repetition ( ...
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 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 software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools ...
(IDE) and supports
DOS DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems. DOS may also refer to: Computing * Data over signalling (DoS), multiplexing data onto a signalling channel * Denial-of-service attack (DoS), an attack on a communicat ...
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 series of Microsoft Windows computer operating systems produced from 1995 to 2000, which were based on the Windows 95 kernel and its underlying foundation of MS-DOS, both of which were updated in sub ...
series and
Windows NT Windows NT is a proprietary graphical operating system produced by Microsoft, the first version of which was released on July 27, 1993. It is a processor-independent, multiprocessing and multi-user operating system. The first version of Win ...
series of operating systems, including
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was release to manufacturing, released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct upgrade to its predecessors, Wind ...
,
Windows Server 2008 Windows Server 2008 is the fourth release of the Windows Server operating system produced by Microsoft as part of the Windows NT family of the operating systems. It was released to manufacturing on February 4, 2008, and generally to retail on F ...
,
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, which was released five years before, at the time being the longest time span between successive releases of ...
, 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 Dynamic-link library (DLL) is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems. These libraries usually have the file extension DLL, OCX (for libraries containing ActiveX controls), or ...
(DLLs). The compiler comes with an IDE including an editor and stepping
debugger A debugger or debugging tool is a computer program used to test and debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the programmer to track its executi ...
. 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 In computing, Common Gateway Interface (CGI) is an interface specification that enables web servers to execute an external program, typically to process user requests. Such programs are often written in a scripting language and are commonly r ...
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 series of Microsoft Windows computer operating systems produced from 1995 to 2000, which were based on the Windows 95 kernel and its underlying foundation of MS-DOS, both of which were updated in sub ...
series and the
Windows NT Windows NT is a proprietary graphical operating system produced by Microsoft, the first version of which was released on July 27, 1993. It is a processor-independent, multiprocessing and multi-user operating system. The first version of Win ...
series of operating systems, including
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was release to manufacturing, released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct upgrade to its predecessors, Wind ...
,
Windows Server 2008 Windows Server 2008 is the fourth release of the Windows Server operating system produced by Microsoft as part of the Windows NT family of the operating systems. It was released to manufacturing on February 4, 2008, and generally to retail on F ...
,
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, which was released five years before, at the time being the longest time span between successive releases of ...
,
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 released to manufacturing on August 1, 2012; it was subsequently made available for download via MSDN and TechNet on August 15, 2012, and later to ...
(
8.1 Windows 8.1 is a release of the Windows NT operating system developed by Microsoft. It was released to manufacturing on August 27, 2013, and broadly released for retail sale on October 17, 2013, about a year after the retail release of its pre ...
), and
Windows 10 Windows 10 is a major release of Microsoft's Windows NT operating system. It is the direct successor to Windows 8.1, which was released nearly two years earlier. It was released to manufacturing on July 15, 2015, and later to retail on ...
. PBWin can create
dynamic-link libraries Dynamic-link library (DLL) is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems. These libraries usually have the file extension DLL, OCX (for libraries containing ActiveX controls), or ...
. PBWin applications can read dynamic-link libraries]. PBWin comes with a compiler, IDE with editor, and stepping
debugger A debugger or debugging tool is a computer program used to test and debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the programmer to track its executi ...
.


Dynamic Dialog Tools (DDT)

You can create an application's
graphical user interface The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, ins ...
using the
Windows API The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations th ...
, or by using the built-in DDT language extensions. The group of BASIC statements which wrap
Windows API The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations th ...
functions, particularly in the creation and handling of
dialog box The dialog box (also called dialogue box (non-U.S. English), message box or 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 ar ...
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 Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations th ...
. 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 The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, ins ...
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 Assembler may refer to: Arts and media * Nobukazu Takemura, avant-garde electronic musician, stage name Assembler * Assemblers, a fictional race in the ''Star Wars'' universe * Assemblers, an alternative name of the superhero group Champions of ...
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 processing in Flynn's taxonomy. SIMD can be internal (part of the hardware design) and it can be directly accessible through an instruction set architecture (ISA), but it shoul ...
, and
MMX MMX may refer to: * 2010, in Roman numerals Science and technology * MMX (instruction set), a single-instruction, multiple-data instruction set designed by Intel * MMX Mineração, a Brazilian mining company * Martian Moons eXploration, a Japane ...
, 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

Hello world ''Hello'' is a salutation or greeting in the English language. It is first attested in writing from 1826. Early uses ''Hello'', with that spelling, was used in publications in the U.S. as early as the 18 October 1826 edition of the '' Norwich ...
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


Object-oriented programming

PBWin and PBCC support
object-oriented programming Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
in the form of
COM Com or COM may refer to: Computing * COM (hardware interface), a serial port interface on IBM PC-compatible computers * COM file, or .com file, short for "command", a file extension for an executable file in MS-DOS * .com, an Internet top-level d ...
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. Windows apps use Windows API to interact with GD ...
(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 The dialog box (also called dialogue box (non-U.S. English), message box or 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 ar ...
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 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. Windows apps use Windows API to interact with G ...
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.PowerBASIC's vBulletin forum software statistics


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 digital library with the stated mission of "universal access to all knowledge". It provides free public access to collections of digitized materials, including websites, software applications/games, music, ...
: *
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

PlanetSquires Forums
{{BASIC BASIC compilers BASIC programming language family Borland software DOS software Articles with example BASIC code