module
25

The whole primer on one page: each thing from the Turbo course, and what HiSoft Pascal has instead.
| In the Turbo course | In HiSoft Pascal | Section |
|---|---|---|
TURBO, its menu and its editor | XBAS to type the program as numbered lines; SAVE "NAME.ASC"; DOS | S3 |
R to compile and run; C for a .COM | HPEIN NAME makes NAME.COM; NAME runs it | S4 |
| Compiling again | File exists - Delete? - Y, or HPEIN NAME;Y | S4 |
| A compile error opens the editor at the place | *ERROR*, ^ and a number, by line; E to stop; fix it in XBAS | S4 |
Hello's .COM: 8,064 bytes | 3,584; 1,920 with ;R | S4 |
Run-time error and a number | A message in words and at PC= an address; the listing shows the line | S5 |
A loop stops on CTRL-C only under {$U+} | Stops on CTRL-C unless (*$C-*) | S5 |
| About 39,000 empty passes a second | About 1,440 by default; about 44,000 under (*$C-*) | S5 |
{ } comments | (* *) only - XBAS changes { and } | S3 |
? in a message | CHR(63) - XBAS changes ? | S3 |
| Indenting | Not kept by XBAS | S3 |
| An integer written with no space | A space after it, unless a width is given | S6 |
| Overflow never caught | Caught for two variables and for *; not for a constant added | S6 |
div by zero gives -1 | / by Zero stops the program | S5, S6 |
| Reals of 11 digits, 18 columns | About 7 digits, 12 columns | S6 |
Round(-2.5) is -3 | ROUND(-2.5) is -2; ENTIER rounds down | S6 |
Sin, Cos, Exp... always there | Only with ;T | S6 |
| Names in any case | Pascal's words in capitals; names case-sensitive - but XBAS makes everything capitals | S7 |
| - | Only eight characters of a name count; a name declared twice is not caught | S7 |
string[n], Length, Copy, Pos, + | ARRAY[1..n] OF CHAR of exact-length texts; write your own | S8 |
| - | AND always works out both sides | S8 |
Readln | READLN before every READ of letters - input starts with an empty line | S9 |
| DELETE does nothing while answering | DELETE rubs out | S9 |
case ... else ... end | CASE ... ELSE statement - no END | S10 |
| - | A line starting with a digit needs (**) in front, in XBAS | S10 |
Recursion needs {$A-} | Recursion works as it stands | S10 |
| Arrays of the same type assign | Only if declared together or with the same type name | S11 |
Index checked only under {$R+} | Index checked by default; subranges never | S11 |
Assign, Rewrite, Close; typed files | REWRITE(F,'A:NAME .EXT'); text files only; no Close | S12 |
Reset of a missing file: I/O error 01 | No error: EOF at once | S12 |
| - | The first three characters of each piece read come back wrong: a buffer bigger than the file (TEXT[8]) and a spare first line | S12 |
Dispose, MemAvail | MARK and RELEASE only; NEW never says full | S13 |
ClrScr | PAGE | S14 |
GotoXY(Col, Row) from 1 | WRITE(CHR(29),CHR(col),CHR(row)) from 0 - or your own GOTOXY | S14 |
| - | TCOL(f,b) for coloured text | S14 |
Read(Kbd, Ch), KeyPressed | INCH, under (*$C-*) | S15 |
Random(n), Randomize | RANDOM 0-255, no seed - best taken after a key press | S16 |
| No graphics | DRAW, PLOT, POINT, POLY, FILL, ORIGIN, GCOL | S17 |
| No sound | PSG(register,value) - and 126 in register 7 | S18 |
Mem[a], Addr | PEEK(a,type), POKE, ADDR | S19 |
Port[n] | OUT(n,CHR(v)), INP(n) | S19 |
inline with a variable's name | INLINE of constants only; USER(a) | S19 |