PowerBASIC

Last updated
PowerBASIC
PowerBasic-screen-shot.png
Screenshot of PowerBASIC for Windows 9.0 IDE and an example compiled Windows GUI.
Developer Robert "Bob" Zale (b. 1945, d. 2012)
First appeared1989;34 years ago (1989)
Stable release
10.0 (4 May 2011;12 years ago (2011-05-04)) [1]
OS Windows (32-bit only), MS-DOS
Website www.powerbasic.com
Influenced by
Turbo Basic

PowerBASIC, formerly Turbo Basic, is the brand of several commercial compilers by PowerBASIC Inc. that compile a dialect of the BASIC programming language. 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. 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.

Contents

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.

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. [2] [3] [4]

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. [5] On May 10, 2015, Vivian Zale announced that work was continuing on new versions of PowerBASIC compilers. [6]

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. [7] This was later confirmed by Vivian Zale with a forum post thanking the members for their support. [8]

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 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 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 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,[ citation needed ] 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$DOs$=""INPUT"How many stars do you want to print";sFORi=1TOss$=s$+"*"NEXTiPRINTs$DOINPUT"Do you want to print more stars";q$LOOPWHILELEN(q$)=0q$=LCASE$(LEFT$(q$,1))LOOPWHILEq$="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 (IDE) and supports DOS 3.30 and all later versions. [9]

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 (DLLs). 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 (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 (8.1), and Windows 10. [10] 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 (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). [11]

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. [12]

Programming language

Characteristics

PowerBASIC is a native-code BASIC compiler whose reported merits are simplicity of use and speed compared to other languages. [13] [14] 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, 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

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.

FunctionPBMainPrint"Hello, World!"Waitkey$EndFunction

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

FunctionPBMainMsgBox"Hello, World!"EndFunction

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 (GDI) library functions. [15] [16]

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 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:

#CompileExe' using either PBCC6 or PBWIN10 compiler#DimAllFunctionPBMainLocalGWAsDword' start a GRAPHIC WINDOWGraphicWindowNew"graphic window",100,100,200,200toGW' show a coloured discGraphicEllipse(10,10)-(190,190),%rgb_Red,%rgb_SeaGreen,0' wait for a keypressGraphicWaitkey$EndFunction
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 [17] 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. [18] 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. [19]

Related Research Articles

Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named after French mathematician, philosopher and physicist Blaise Pascal.

Turbo Pascal is a software development system that includes a compiler and an integrated development environment (IDE) for the Pascal programming language running on CP/M, CP/M-86, and DOS. It was originally developed by Anders Hejlsberg at Borland, and was notable for its extremely fast compilation. Turbo Pascal, and the later but similar Turbo C, made Borland a leader in PC-based development.

Visual DialogScript (VDS) is an interpreted programming language for Microsoft Windows. It can be used to create small and fast programs. VDS has a large number of dialog and graphic elements available to create professional-looking programs. VDS programs have access to the Windows API; therefore, it is possible to write applications that can perform the same advanced tasks as other programming languages such as Visual Basic, C++, or Delphi.

<span class="mw-page-title-main">PureBasic</span>

PureBasic is a commercially distributed procedural computer programming language and integrated development environment based on BASIC and developed by Fantaisie Software for Windows, Linux, and macOS. An Amiga version is available, although it has been discontinued and some parts of it are released as open-source. The first public release of PureBasic for Windows was on 17 December 2000. It has been continually updated ever since.

<span class="mw-page-title-main">Windows API</span> Microsofts core set of application programming interfaces on Windows

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 that are often referred to by their own names. Almost all Windows programs interact with the Windows API. On the Windows NT line of operating systems, a small number use the Native API.

The Visual Component Library (VCL) is a visual component-based object-oriented framework for developing the user interface of Microsoft Windows applications. It is written in Object Pascal.

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. For example, a compiler that runs on a PC but generates code that runs on an Android smartphone is a cross compiler.

<span class="mw-page-title-main">Text-based user interface</span> Type of interface based on outputting to or controlling a text display

In computing, text-based user interfaces (TUI), is a retronym describing a type of user interface (UI) common as an early form of human–computer interaction, before the advent of modern conventional graphical user interfaces (GUIs). Like GUIs, they may use the entire screen area and accept mouse and other inputs. They may also use color and often structure the display using special graphical characters such as ┌ and ╣, referred to in Unicode as the "box drawing" set. The modern context of use is usually a terminal emulator.

Clarion is a commercial, proprietary, fourth-generation programming language (4GL), multi-paradigm, programming language and integrated development environment (IDE) from SoftVelocity used to program database applications. It is compatible with indexed sequential access method (ISAM), Structured Query Language (SQL), and ActiveX Data Objects (ADO) data access methods, reads and writes several flat file desktop database formats including ASCII, comma-separated values (CSV), DOS (binary), FoxPro, Clipper, dBase, and some relational databases via ODBC, Microsoft SQL Server, Sybase SQL Anywhere, and Oracle Database through the use of accelerated native database drivers, and XML, Clarion can be used to output to HTML, XML, plain text, and Portable Document Format (PDF), among others.

<span class="mw-page-title-main">GFA BASIC</span> Computer programming language

GFA BASIC is a dialect of the BASIC programming language, by Frank Ostrowski. The name is derived from the company, which distributed the software. In the mid-1980s to the 1990s it enjoyed popularity as an advanced BASIC dialect, but has been mostly superseded by several other programming languages. Official support ended in the early 2000s.

Object Pascal is an extension to the programming language Pascal that provides object-oriented programming (OOP) features such as classes and methods.

<span class="mw-page-title-main">Free Pascal</span> Free compiler and IDE for Pascal and ObjectPascal

Free Pascal Compiler (FPC) is a compiler for the closely related programming-language dialects Pascal and Object Pascal. It is free software released under the GNU General Public License, with exception clauses that allow static linking against its runtime libraries and packages for any purpose in combination with any other software license.

A DOS extender is a computer software program running under DOS that enables software to run in a protected mode environment even though the host operating system is only capable of operating in real mode.

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, or DRV . The file formats for DLLs are the same as for Windows EXE files – that is, Portable Executable (PE) for 32-bit and 64-bit Windows, and New Executable (NE) for 16-bit Windows. As with EXEs, DLLs can contain code, data, and resources, in any combination.

Borland C++ is a C and C++ IDE released by Borland for MS-DOS and Microsoft Windows. It was the successor to Turbo C++ and included a better debugger, the Turbo Debugger, which was written in protected mode DOS.

The Microsoft Windows operating system supports a form of shared libraries known as "dynamic-link libraries", which are code libraries that can be used by multiple processes while only one copy is loaded into memory. This article provides an overview of the core libraries that are included with every modern Windows installation, on top of which most Windows applications are built.

<span class="mw-page-title-main">Borland Graphics Interface</span>

The Borland Graphics Interface, also known as BGI, was a graphics library bundled with several Borland compilers for the DOS operating systems since 1987. BGI was also used to provide graphics for many other Borland products including the Quattro Pro spreadsheet.

Turbo Debugger (TD) is a machine-level debugger for DOS executables, intended mainly for debugging Borland Turbo Pascal, and later Turbo C programs, sold by Borland. It is a full-screen debugger displaying both Turbo Pascal or Turbo C source and corresponding assembly-language instructions, with powerful capabilities for setting breakpoints, watching the execution of instructions, monitoring machine registers, etc. Turbo Debugger can be used for programs not generated by Borland compilers, but without showing source statements; it is by no means the only debugger available for non-Borland executables, and not a significant general-purpose debugger.

XBLite is a free Open Source BASIC programming language compiler and development system. It was started in 2001 by David Szafranski in order to provide a Windows exclusive version of the XBasic dialect. XBLite is released under the GNU GPL licensing scheme, Standard libraries are released under the GNU LGPL licensing scheme.

References

  1. Release of PowerBASIC 10.0 Compiler for Windows
  2. "PowerBASIC makes smooth move; Tech company finds region's affordability attractive". Sarasota Herald Tribune. 2000-10-10. Retrieved 2008-03-12.
  3. Tooley, Michael H. (2005). PC Based Instrumentation and Control . Elsevier. p.  214. ISBN   0-7506-4716-7.
  4. "An Introduction to PowerBASIC". Archived from the original on 2011-05-27. Retrieved 2010-12-07.
  5. Zale, Vivian. "PowerBASIC Update". PowerBASIC Forums. PowerBASIC. Retrieved 5 July 2015.
  6. Eccles, John. "PowerBASIC Plans". PowerBASIC Forums. PowerBASIC, Inc. Archived from the original on 24 September 2015. Retrieved 5 July 2015.
  7. Drake, Adam (January 31, 2017). "PowerBASIC Has a New Home". PowerBASIC Support Forums. Archived from the original on 2017-02-19.
  8. Zale, Vivian (February 12, 2017). "Thank You". PowerBASIC Support Forums. Archived from the original on 2017-02-19.
  9. "PowerBASIC 3.5 for DOS". Archived from the original on 2016-01-17.
  10. "PowerBASIC Compiler for Windows". Archived from the original on 2008-03-08.
  11. PowerBASIC 9 for Windows and PowerBASIC Console Compiler 5: $99 and $89 on 2016-10-05; $0 and $0 on 2016-11-06; $0 and $0 on 2016-12-18; not offered on 2017-02-28.
  12. "Com Browser on PowerBASIC's website".
  13. 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") Google Books
  14. 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") Google Books
  15. "PowerBASIC".
  16. "PowerBASIC".
  17. Petzold, Charles (1998). Programming Windows Fifth Edition, Microsoft Press, ISBN   978-1-57231-995-0
  18. "PowerBASIC".
  19. PowerBASIC's vBulletin forum software statistics

Third-party support