# Pascal Primer for the Macintosh — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1)

## Transcribed source material

Machine transcriptions and image descriptions; uncertain copy may be marked [illegible]. Verify against the linked originals. Historical rights remain with the original owners.

These are transcribed excerpts, not the full publications. Open the originals for remaining pages.

### Image 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-7ba9601f9323083e14da3f2f1392c87c2ee8bab9ebaf3f77de8a6bfa612d61b6)

PASCAL PRIMER FOR THE MACINTOSH

Transcribed text:

The Waite Group

PASCAL
PRIMER FOR THE
MACINTOSH®

PLUME
WAITE

A complete guide to Apple's own version of Pascal
• Shows how to program exciting QuickDraw graphics
• Covers the mouse, cursor, and window manipulation
• Demonstrates the new event-driven programming approach
• Teaches through hands-on programming examples

by Dan Shafer

Image description: A book cover with a red background, large white and yellow sans-serif title text, and a large lavender decorative script letter M with striped shading, plus a small Plume Waite logo in the upper right corner.

Reading notes: The cover is a book jacket rather than an advertisement; the author name 'Dan Shafer' is printed in yellow at the bottom. The 'Waite Group' line is in a yellow script font and the 'PLUME WAITE' logo text is small and partly overlapped by a diagonal crease mark at upper right.

Languages: English

[Original Image 1](https://www.vintageapple.net/files/a34ac97190b2274df227086cc86eaf0cbf7a60a8eb5c3e85c57b6edfe3571d8a/0dfe264a36ebfa5189048231.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-b0aab2830aa2f19618e1d083f03d4e1050be087aa337f72c75a74e797332f8aa)

Transcribed text:

The Waite Group
PASCAL PRIMER FOR THE MACINTOSH®
PLUME WAITE
A complete guide to Apple's own version of Pascal
• Shows how to program exciting QuickDraw graphics
• Covers the mouse, cursor, and window manipulation
• Demonstrates the new event-driven programming approach
• Teaches through hands-on programming examples
by Dan Shafer

Image description: A red book cover with yellow script 'The Waite Group' at top, large white sans-serif title, a large lavender decorative script letter M filling the lower middle, and yellow bullet-point subtitle text at the bottom left, with a Plume Waite logo at upper right.

Reading notes: Small wear marks and specks on the cover; the word 'window' in the bullet list is partly obscured by a mark near 'wi' and 'ndow' and was read as 'window'. The 'M' ornament is a decorative graphic, not text, and was not transcribed as a letter beyond its inclusion in the description.

Printed product names: Macintosh

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-c726f4a046341aa4a57ed08458a6912328fbd00ab48604635ffff96e52499f3e)

Transcribed text:

Another book by the bestselling authors of   ASSEMBLY
LANGUAGE   PRIMER   FOR   THE IBM® PC & XT and   BLUEBOOK
OF   ASSEMBLY   ROUTINES   FOR   THE IBM® PC   &   XT   ....   And rave
reviews for The Waite Group:
"A,nyone   who is new to assembly language programming on the IBM   PC
and feels completely at sea will find a welcome port in Robert Lafore's
Assembly Language   Primer   for the IBM   PC   &   XT."
-John Figueras, reviewing
Assembly   Language Primer for the IBM   PC   &   XT, in Byte
"[Chris   Morgan] has succeeded in producing a volume that no assembly
language programmer can do   without."
-Bluebook of Assembly   Language Subroutines,
reviewed in The Reader's   Guide   to Microcomputer Books
"An   outstanding example of how to write a technical book for the begin-
ner ... refreshingly enjoyable ... accurate, readable, understandable, and
indispensible. Don't stay home without   it."
-Ken Barber, reviewing
CPIM   Primer, in Microcomputing
"Mitch   Waite .. . has left a distinctive contribution to the literature of
computer graphics ... seeing it here is like understanding   it   for the first
time."
-Computer Graphics Primer, reviewed in
Computer Graphics World
"It's   hard to imagine that a field only a decade old already has a classic,
but Waite's book is just   that."
-Tony Dirksen, reviewing
Computer Graphics Primer in Interface   Age
"   ... does an excellent job of demystifying the whole study of computer
programming in   BASIC."
-   Annie Fox, reviewing
BASIC   Primer in Creative Computing

Reading notes: Some words are split by irregular spacing in the source text, such as 'A,nyone' and 'Bluebook of Assembly Language Subroutines'.

Printed product names: IBM PC · XT · Assembly Language Primer for the IBM PC & XT · BLUEBOOK OF ASSEMBLY ROUTINES FOR THE IBM PC & XT · CPIM Primer · Computer Graphics Primer · BASIC Primer

Languages: English

[Original PDF page 2](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-fd699f6b756ded0d33591e534c41198e507dc126af57f6260c5939a5f987d463)

Transcribed text:

Dan   Shafer   is an independent product consultant and freelance
writer who has been employed for eight years in various phases
of high technology in California's   Silicon   Valley.   A former
journalist and public relations consultant, he lists writing as
his first love, even though he is also keenly interested in pro-
gramming, chess, stamp collecting, law, and religion. While
this is his first published book, dozens of his product reviews
and feature articles have appeared in computer magazines
during the past five years. Dan lives in Sunnyvale, California,
with his wife, Carolyn, and their four daughters:   Sheila,   Mary,
Christine, and Heather.

Printed dates: eight years · past five years

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-981165e79515ee951ceec92ebca18a5cc650d5130637ec2e4e416d29b9963d8e)

Transcribed text:

Dan Shafer

Pascal Primer for the Macintosh®

A Plume/Waite Book
New American Library
New York and Scarborough, Ontario

Image description: A book title page with a black author name and rule at top, large blue bold title text in the center, and a blue circular publisher logo above a black publisher imprint block at lower left on a white background.

Reading notes: The ® symbol after Macintosh is a registered-trademark mark rendered as a superscript circle-R; transcribed as ®. Publisher logo is a blue circular emblem with no printed text, so no transcription is given for it. Product name 'Macintosh' is part of the title and may be a trademark reference rather than an advertised product.

Printed product names: Macintosh

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-b635de9e27e3be3154a0fc0ea94349d154946f7b48ec22f3ecbf468b1f0134c3)

Transcribed text:

NAL   BOOKS   ARE AVAILABLE AT   QUANTITY   DISCUJNTS   WHEN   USED   TO   PROMOTE   PRODUCTS
OR   SERVICES.   FOR   INFORMATION   PLEASE   WRITE   TO   PREMIUM   MARKETING   DIVISION,   NEW
AMERICAN LIBRARY, 1633 BROADWAY, NEW   YORK,   NEW   YORK   10019.
Copyright©1985   by   The Waite Group, Inc. All rights reserved. For information address New American
Library.
Several trademarks and/or service marks appear in this book. The companies listed below own or
are licensed to use the trademarks and/or service marks following their names.
Apple Computer, Inc.: Macintosh, MacPaint, MacWrite, Lisa
Digital Deli
®  PLUME   TRADEMARK REG.   U.S.   PAT.   OFF.   AND FOREIGN   COUNTRIES
REGISTERED TRADEMARK- MARCA REGISTRADA
HECHO   EN   WESTFORD,   MASS.,   U.S.A.
SIGNET,   SIGNET   CLASSIC,   MENTOR,   PLUME,   MERIDIAN and NAL   BOOKS   are published in the
United   States   by New American Library, 1633 Broadway, New York, New York   10019,   in Canada
by The New American Library of Canada Limited, 81 Mack Avenue, Scarborough, Ontario M1L1M8
Library   of   Congress Cataloging in Publication Data
Shafer,   Dan.
Pascal primer for the Macintosh.
"A   Plume/Waite   book."
Includes index.
l.   Macintosh   (Computer)   -Programming.   2.   PASCAL
(Computer program language)   I.   Title.
QA76.8.M3S53   1985   001.6412   85-4829
ISB'.\!   0-452-25659-9
Interior design by Rick Chafian
Illustrations by Winston and Karen   Sin
Typography by Walker Graphics
First Printing, June, 1985
23456789
PRINTED   IN THE   UNITED   STATES   OF   AMERICA

Reading notes: Possible OCR garbling in ISBN line ('ISB'.\!   0-452-25659-9') and Library of Congress numbers. Line '1.   Macintosh' and catalog entries have uncertain numeral reading ('l.' may be '1.').

Printed product names: Macintosh · MacPaint · MacWrite · Lisa

Printed dates: 1985 · June, 1985 · 85-4829

Languages: English · Spanish

[Original PDF page 5](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-d8f97f7e18b777ddd70c29e2f3fcd14e92ce0c4a192d03b888b68b12ff2689fb)

Image description: The image is a entirely blank white page with no visible artwork, layout, or text.

Reading notes: No visible text found; the page appears blank.

[Original PDF page 6](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-add4b4bc2aed0135882aed53e9c7a923cfffce61472558b7cd9fddf2b9432077)

Transcribed text:

Contents
Acknowledgments   xii
Introduction   xiii
1   An Instant Start on Macintosh Pascal   1
Preparing to Run Macintosh Pascal   1
The Mac Pascal Display   Screen   3
The Menu Bar   5
The Instant Window: Checking   It   Out   in Advance   8
What's All This Talk about   "Programs"?   11
Why Pascal Is Easier to Learn on the Macintosh   11
Summary   13
2   Your First Pascal Program   15
Typing Your First Program   15
The Pause Option   21
Saving   the Program on the Disk   21
Running a Program   23
Programming   One   Step   at a Time   24
Making   It   Different   26
The Programming   Process   26
Summary   28
Mac-r-cises   28
3   Anatomy of a Macintosh Pascal Program   29
Some   Elements   of   Program   Structure   29
Giving Your Creation a Name   31
Comments: What Those Funny Brackets Are For   32
vii

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-0c3884072ba676a896303d24113efa89b664f70f8c438ec3fd037cd1fad71ce3)

Transcribed text:

Begin at the Begin   33
Anything to Declare?   36
Summary   47
Mac-r-cises   47
4   Making Variables Valuable   49
Input and Output   49
The Age   Teller   Program:   An Example of Macintosh   I/O   50
A Variable and Its   Value   5   2
Entering a New Age   54
Reading New Information into a   Program   59
Printing   in the Macintosh Text Window   64
Summary   67
Mac-r-cises   67
5   Fundamental Control Statements   69
What   If   I Want to Do Something Different?   69
Looking for the Yes   70
More Complex   Use   of the   If...   Then   ...   Else Group   72
Just in   Case   78
Running   Programs   Repeatedly   81
"Next!"   81
But What   If   We Don't Know?   88
Checking Before or After the Loop Runs   92
Summary   95
Mac-r-cises   96
6   QuickDraw Graphics from   Pascal   97
Why   Program   Graphics?   97
Quick! Draw Me Something!   99
Random Art   104
Getting Shapelier with   Our   Art   108
Adding Writing to Your Artwork   118
Getting the   Picture   120
Summary   123
Mac-r-cises   124
7   Some   Fun Things to Do with Letters and Words   125
What's a String Again?   125
Types of   String   Manipulation   Procedures   126
Information-Gathering   Procedures   126
Procedures   to   Compare   Strings   129
viii   CONTENTS

Reading notes: Source appears to be a table of contents excerpt; headline is the first listed chapter heading

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-7b8eb6ccea63b35c8a43309869ce58a08288df333f8928d523e3aeb4175fd0d7)

Transcribed text:

New Strings from   Old   131
One   Other   Way to Access Part of a String   139
Summary   139
Mac-r-cises   140
8   Can Numbers Be   So   Much Fun?   141
Types of Numbers in Pascal   141
Displaying Numbers   144
Getting Information about Numbers   145
Creating Numbers at Random   146
Let's   Check   the   Odds   148
Math Quiz Program   150
Other   Calculations   151
Summary   154
Mac-r-cises   155
9   Making Your   Own   Procedures and Functions   156
What Is a Procedure?   156
What Is a Function?   15 7
Examples of Procedures and Functions   157
When Should You   Use   Procedures and Functions?   159
A Grapeful Program   159
Procedures to Simplify Program Design   161
"Scoping"   with Procedures   166
Circles   Have a Point   172
Where Do Functions   Come   In?   17   4
Summary   175
Mac-r-cises   176
10   Structured Data Types I: Arrays   177
Will I Need an Array Gun?   177
Using   Arrays   181
Array Dismay   183
Tables   185
Putting   It   All Together   187
Designing Arrays   189
A Word about Subrange Data Types   189
Summary   191
Mac-r-cises   191
11   Structured Data Types II:   Sets   and Records   193
The Type Section of a Macintosh Pascal Program   193
CONTENTS   lX

Reading notes: Source appears to be a table of contents fragment with no advertised products, prices, or dates Heading text absent; headline set to null

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-f1defa10ebf47349b52554d7d82de723194b843cb44587264e0b8345eabac119)

Transcribed text:

Types of Types   196
Set   'Em   Up!   199
On   the Record   206
Summary   213
Mac-r-cises   214
12   Of   Mice and Events   215
Where's the Mouse?   216
What's the Mouse Doing in There?   218
The Event Queue   221
Summary   228
Mac-r-cises   228
13   Using   the Printer and Disk Files   229
First, a Word about Files   229
Sending   Output to the Printer   230
Permanent, Recoverable   Storage:   Disk Files   233
Summary   237
Mac-r-cises   238
14   Some Advanced Graphics Ideas   239
Cursor   Manipulation   239
Window Pains   242
Moving and Resizing Rectangles   245
Summary   247
Mac-r-cises   248
15   Introduction to Dynamic Data Structures   249
Dynamic Data   249
An Example Program   2 51
Use   of Linked Lists   256
Summary   262
16   Other   Macintosh Goodies   263
Getting Time in Hand   263
The Mac: A   Sound   Decision   266
Beep-Beep!   268
Noteworthy Notes   270
Summary   275
Mac-r-cises   2 75
X   CONTENTS

Reading notes: Source is a table of contents listing chapters and page numbers; no headline, products, prices, or dates are present. Some chapter-title spacing is irregular, such as 'Set   'Em   Up!' and 'Use   of Linked Lists', which may reflect extraction spacing.

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/1#scan-7e21682b6c7c221c5b4f379d4f065c6d87600119d64b46118768be0becc56e2f)

Transcribed text:

17   Three Complete Fun and   Useful   Programs   276
Learning from Others'   Programs   276
The Three   Programs   2 7   7
GridMaker   277
DumpFile   279
ChuckALuck   287
A Friendly   P.S.   292
A   Solutions to Selected Mac-r-cises   293
Index   309
CONTENTS   Xi

Reading notes: Source text appears to be a table of contents with page numbers and some characters run together or irregularly spaced Headings and chapter titles are inconsistently separated, making reading order uncertain

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/ac67e0eefca986fce0fa89afd3df135ef862c5ea9341353ca983e9d2f2d13bbd/Pascal_Premier_For_The_Macintosh_1985.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-pascal-premier-for-the-macintosh-1985-4966ad/2.md)
