Classic Computer Magazine Archive COMPUTE! ISSUE 146 / NOVEMBER 1992 / PAGE 60

Using PDS 7.1. (Professional Development System) (Column)
by Tom Campbell

We looked recently at several of Microsoft's BASIC dialects. This month's theme is Professional Development System 7.1, currently Microsoft's highest-end BASIC.PDS 7.1 is compatible with QuickBASIC and sports many more code generation options, OS/2 support, and incredibly powerful built-in ISAM database routines. Plus, it has a couple of libraries thrown in.

This month, we'll look at what you can do with the Presentation Graphics toolbox and how purchasing the $295 PDS 7.1 might be worthwhile just for that toolbox. If your billable time is worth $50 an hour, you could buy PDS 7.1 for a single business graphics project and have a topnotch development system after the gig is over.

The toolbox has support for CGA, EGA, MCGA, VGA, Hercules, and Olivetti cards; and it uses Windows screen fonts. You're even licensed to distribute the half-dozen screen fonts that come with PDS 7.1 as part of your application.

If you've ever found a charting package lacking in flexibility, this month's PowerChart might well be what you need. A data-driven charting program, it creates its chart using its own command language. Feed it a text file, and it will create a chart or series of charts by reading the directions in the file and displaying the chart onscreen. Here's an example.

CHART 1 TYPE "BAR" USE CHART 1 LABELS "Wayne's World", "Basic Instinct", "Lethal Weapon 3" DATA 110.5, 87.9, 114.6 TITLE "Box Office in Millions" JUSTIFY TITLE LEFT SHOW PAUSE

Put that in a text file called test.pc and run it through the PowerChart program by typing pchart test.pc. The chart will be shown on your graphics monitor and will await a keypress; then it will return to text mode. "Wait a minute," you say. "I did all that work just to create a bar chart? I could do that in Harvard Graphics in seconds!"

True. But PowerChart is an extensible language, one that you can add to by following the directions in the source code and program documentation. Don't like the way your graphics program displays axes? PowerChart gives you full control over how they're drawn, what pattern and color they use, and so on.

The JUSTIFY TITLE statement is included to show you how PowerChart changes a default value. Using a simple language also gives you the ability to write other programs in BASIC that generate source code for PowerChart. You might also notice that the source code listed above requires only 202 bytes of storage as a text file. Even the most parsimonious graphics file formats would have difficulty matching this figure.

To begin, you must first start QBX (remember that PDS 7.1 or higher must be used for this column; QuickBASIC doesn't come with the Presentation Graphics toolbox). To load the quick library for the toolbox, type qbx /l chartbefr.

If you start QBX without loading a quick library first, there's no way to load one without restarting. Another limitation is that you can only load one quick library at a time, so if you want features from several quick libraries, you'll have to monkey around with lib.exe to extract only those routines into a new library.

If you like to work in a separate directory for each project to avoid clutter, you should make sure that the QBX environment knows where you keep your libraries and include files. Choose Set Paths from the Options directory and write in the appropriate settings; on most systems, they would be c: include; c: src for include files and c: lib; c: src for library files.

The SRC directory is where the PDS 7.1 installation program puts all the graphics example files and the toolbox source. It also puts the font files there; that way, if you run a program such as the sample programs that come with PDS 7.1, it assumes the fonts are in the current directory.

PowerChart uses a general-purpose function called SearchPath, which takes a path-style string as its input and searches those directories for the named file. It also looks in the directory it started from, if you're using DOS 3.0 or higher (a DOS 2 program has no way of knowing from which directory it executed, but starting with version 3, that information is available just after the environment table).

PowerChart doesn't support all of BASIC 7's chart types, but adding to its is simple. Look at the TRANSLATE routine in translat.bas, and you'll see instructions on how to add chart types and examples of existing ones. That's why the first line of test.pc puts the word bar in quotes.

CHART 1 TYPE "BAR".

Make it a string variable instead of a keyword, and you can add to SELECT CASE CHARTTYPE without adding keywords to the language. And later, you can even add chart types that aren't supported by the Presentation Graphics Toolbox, without disturbing the main parsing routines. Try that, Harvard Graphics!