Personal Computer News


Petite Pascal

 
Published in Personal Computer News #075

David Rosam crunches numbers on a Dragon with Petite Pascal.

Personal Pascal

David Rosan crunches numbers on a Dragon with Petite Pascal

Unless you learned to program in an institute of higher education, it's almost 99 per cent certain that you cut your teeth on Basic. Basic is easy to learn and use - especially for the beginner, so it has become the universally accepted language for home micros.

If, on the other hand, you have a mainframe or a mini to play with, Basic looks a great deal less attractive. We've all heard the mutterings about the dire effect of too much Basic on our programming habits, and we've all got into huge muggles when trying to write longer programs. The answer, we are told, is to program in Pascal instead - and the introduction of Petite Pascal has now made this option open to all Dragon owners.

Documentation

The 41 pages of documentation are no more than average - and is there no software house out there which can spell? A little more effort and it could have been excellent. A demonstration cassette is supplied.

In Use

The compiler loads quickly from cassette and only needs EXEC to be typed before it is ready to use. Don't be tempted to sit at the keyboard at this stage: Pascal is a structured language and places extra demands on you, the programmer. You are forced by the constraints of the language to go away and work out the whole program on paper before typing it in - but this does help to produce good programming.

Oasis has opted to use the Dragon's Basic editor, so programs written with this package are entered with line numbers and an apostrophe, a little like some of the cruder assemblers which ask you to enter the mnemonics in REM statements. Programs, then, don't look too much like those you may be familiar with from elsewhere.

The advantage of using the Basic editor is that no special editor has needed to be designed, which would also eat up some vital RAM space. I was surprised to see that, even after the program had been compiled, typing EDIT would allow me to edit or correct a line. The error messages are very clear, with an arrow indicating exactly where the mistake is.

A program written for use with the compiler looks like this:

100 'CONST NUM1=3; NUM2=4;
110 'VAR NUM3: INTEGER;
120 'BEGIN
130 'NUM3=NUM1+NUM2;
140 'WRITE(NUM3)
150 'END.

Compare it with the equivalent in Basic:

100 A=3+4
110 PRINT A

The Pascal program is far more longwinded, but don't be put off as you will reap the benefits when writing long programs - the ones that most benefit from structuring.

The first two lines of the Pascal program could be thought of as an extended remark; having to define all the constants and variables at the start gives a great deal of information to anyone looking at the program. The program itself is sandwiched between the BEGIN and END statements.

That's all I'm going to say about Pascal itself, because there's not enough space in this review - the manual lists a number of books which will help you to get to grips with it.

Typing RUN0 will compile the program and run it. The program is listed as it is compiled, with any output appearing on the screen below the compiled listing. Petite Pascal compiles very quickly, so the listing doesn't slow the program appreciably.

Verdict

Petite Pascal is a package that's very easy to use. It will enable many Dragon owners to dip into Pascal, and perhaps acquire some better programming habits which you hope will spill over into other programming. As an introduction it fills the bill, but be warned: it's not the same as the Pascals you'll find on mainframes.

As an end in itself, Pascal doesn't bear comparison with the Dragon's resident Basic. There are no high resolution graphics or sound commands, so if your interests lie in this direction you'll not find much satisfaction in this package. Oasis may have lost out on people who might want to take advantage of a language with increased speed without the dubious pleasures of learning machine code.

If, on the other hand, you wish to use your Dragon for something like data processing, Petite Pascal may be the answer - it'll soon whizz through any number crunching you set it.

Another potential drawback is that once you've written your programs, you'll find your friends won't be able to run them without the Petite Pascal compiler, so you could find Pascal programming a solitary vice.

An interesting package, but I don't think Oasis will find themselves on the bestsellers lists with this one.

Report Card

Features 2/5
Usability 4/5
Documentation 3/5
Reliability 4/5
Overall value 3/5

 

Pascal Reserved Words

ABS
AND
ARRAY
BEGIN
CALL
COLOUR
CONST
DIV
DOWNTO
END
FOR
FUNC
INKEY
GRAPHICS
INTEGER
MEM
MOD
OR
PLOT
POINT
PROC
READ
SHL
SHR
SQR
TEXT
TO
UNTIL
VAR
WRITE

Pascal Structures

IF ... THEN ... ELSE
WHILE ... DO
CASE ... OF

David Rosan