# Macintosh Hands-On Pascal — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/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-macintosh-hands-on-pascal-1986-9144f0/1#scan-273625809250162c031d68d704f17871d2fba033e843b81f357226cac4d0b925)

Transcribed text:

Macintosh™ Hands-On Pascal

Pascal

T. G. Lewis
Abbas Birjandi

Begin
While X <> Y
If X > Y
Then X :=
Else

Jacobs
89

Image description: A book cover with orange and yellow title text on a dark maroon-to-orange gradient background, showing an illustrated Macintosh computer whose screen displays a flowchart and a magnified code snippet held by a hand, with another hand typing on the keyboard.

Reading notes: The small 'Jacobs 89' signature in the lower right may be an artist credit and its year is uncertain. The code snippet inside the magnifier is partly cut off at the edges and may be incomplete. The trademark symbol after Macintosh is small and raised; its exact placement is uncertain.

Printed dates: 89

Languages: English

[Original Image 1](https://www.vintageapple.net/files/4687beffd62c52c6b91354c9df72bdb80f97b1321a5a962d4c232c4531e4292c/e8fc842df8fdd39019381327.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-4dc996bf352a8eb8bbd5724f8490385c0c65eead297cef9ecd29d133d3b58603)

Transcribed text:

Macintosh™ Hands-On Pascal

T. G. Lewis
Abbas Birjandi

Begin
While X <> Y
If X > Y
Then X :=
Else

JACOBS 85-

Image description: A book cover showing an illustrated Macintosh computer with a magnifying glass held by a hand over a screen displaying a flowchart and Pascal code, against a dark maroon-to-orange gradient background, with a hand typing on the keyboard.

Reading notes: The signature 'JACOBS 85-' in the lower right corner is small and partially cut off, so the year and trailing characters are uncertain. The code on the screen is partially visible and cut off by the magnifying glass, so 'Else' may be followed by hidden text. The trademark symbol after Macintosh is small and rendered as ™ in the transcript.

Printed dates: 85

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-0644049bad77346a314c7c97e55b5ffd0aa1980b2ee01fd3e65c459f7563f14a)

Transcribed text:

Macintosh™ Hands-On Pascal

Don Barr

14-

Image description: A plain white title page with a spiral-binding punch edge on the left, the printed title centered in the upper third, and a blue handwritten signature "Don Barr" with the handwritten marking "14-" in the upper right corner.

Reading notes: Handwritten name and the "14-" marking in the upper right are informal and may be read with some uncertainty; the handwritten "14-" may be a partial page or section number. A partially visible curved mark at the top edge is not legible text.

Languages: English

[Original PDF page 2](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-a04c45a46037b607ef84812d1c9ade47bbf2d00ee93653bc124b391c71b3ff04)

Macintosh™ Hands-On Pascal

Transcribed text:

-
-
-
-
-
-
-
-
Macintosh™   Hands-On   Pascal
Ted G. Lewis
Abbas Birjandi
Wadsworth Publishing Company
Belmont, California
A Division of Wadsworth, Inc.

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-9cc7abcc62085ac70192f7f6e37217daf1cbea6a0ebff21ed4a6bf3ff1abbe28)

Transcribed text:

Production   Management:   Miller/Scheier Associates
Cover   Designer:   Detta Penna
®1986   by Wadsworth, Inc. All rights reserved. No part of this book may
be reproduced, stored in a retrieval system, or transcribed, in any form
or by any means, electronic, mechanical, photocopying, recording, or
otherwise, without the prior written permission of the publisher,
Wadsworth Publishing Company, Belmont, California   94002,   a division
of Wadsworth, Inc.
Printed in the   United   States of America
1 2 3 4 5 6 7 8 9   10   90   89 88 87 86
ISBN   0-534-06354-3
Apple is a trademark of Apple Computer, Inc.
Macintosh is a trademark licensed to Apple Computer, Inc.
Library of Congress   Cataloging-in-Publication Data
Lewis, T. G. (Theodore Gyle), 1941-
Macintosh hands-on Pascal.
Includes index.
1. Macintosh (Computer)-Programming. 2.   Pascal
(Computer program language)   I.   Birjandi, Abbas.
II.   Title.
QA76.M3L49   1986   005.265   85-20200
ISBN   0-534-06354-3
"11"!1!
'

Reading notes: Printed page numbering and copyright year sequence are ambiguous in the copyright block. Trailing garbled characters at the end of the source may be damaged.

Printed product names: Macintosh · Apple

Printed dates: 1986 · 1941 · 1 2 3 4 5 6 7 8 9

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-2d77ecd27706f96bb1ab2a21dc825350c31dbcec9e1e17c9a0f750b0a6d52185)

Transcribed text:

-
-
-
Preftice   xiii
Introduction   xv
Why   Pascal?   xvi
What Is a   Programming   Language?   xvi
How Does Macintosh   Understand   Pascal?   xviii
How to   Use   This Book   xviii
Session   1:   Getting   Started
The Mouse that   Points   1
A   Picture   Language   3
Menus or When Is a Computer Like a Restaurant?   3
Windows into Macintosh   4
Opening a   Pascal   Window   6
Closing a Window   6
Dragging a Window   7
Sizing a Window   7
Scrolling a Window   8
Dialog or Talking Back to Your Macintosh   8
Starting   Pascal   9
Quitting Macintosh   Pascal   11
Summary   11
Problem   Solving   12
1

Languages: English

[Original PDF page 5](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-d638c39b8d10834f94c5278bd943af51e5e52238efd9a860684e2423491e9ab8)

Transcribed text:

vi
Session 2:   Entering, Running, and   Saving   a   Pascal   Program
Running Your First Program   13
Changing a Line of Program Text   15
Running a   Program   16
Bug Dialog   18
Saving Your   Program   For Later   Use   19
Editing   22
Saving Your Edited   Program   22
Restoring a Saved   Program   25
Printing the Current   Program   25
Summary   26
Program   Solving   26
Session 3:   The   Structure   of a Pascal Program
Reserved Keywords   27
Syntax Diagrams   28
Program Statement   29
Identifiers   29
Program   Body   30
Declaration   Part   30
Types   31
Constants   31
Variables   32
Assigning a Value to a Variable   32
Hands on the CandyJar   33
Communicating with the Outside World   35
Writeln vs Write   35
ReadLn   36
A Complete Example   38
Comment Statement   40
Summary   41
Problem Solving   42
CONTENTS
13   -
27
-
I""" I

Languages: English

[Original PDF page 6](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-7b49ed91fd2c83ddcbf46e083325d1373f6340e46126bd847db8597861f5c1d1)

Transcribed text:

CONTENTS
-
-
-
-
-
-
-
-
Session 4:   Integer,   &Al,   11nd   Chllr   Expressions
The Instant Window   43
Integers   45
Reals   47
Char   49
Hands-On Example   50
Summary   51
Problem Solving   52
Session 5:   What   Is   11   Subprogram?
Pascal Subprograms   53
Procedures   54
Hands-On Examples of Procedure GET.MPG   56
Functions   59
Hands-On Example of Function MILEAGE   60
Summary   61
Problem Solving   62
Session   6:   Choosing   in   P11SC11l
Boolean Variables 63
Boolean Operators   64
Boolean Expressions   66
IF Statements   66
RUN-STEP   69
Putting in   STOPS   69
One-Legged IF Statements   70
Compound IF Clauses   70
Hands-On Example of Compound IF Statements   71
Multiway Branching   73
Case Statement   74
A Hands-On Example   77
The Observe Window   78
Summary   78
Problem Solving   78
vii
43
53
63

Reading notes: OCR errors in several headings (e.g., '11nd' for 'And', 'Chllr' for 'Other', '11' for 'a', 'P11SC11l' for 'PASCAL') Page numbers and dot leaders are not clearly aligned with entries

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-ebe6a54ba2a681236a88078282098876663b1a1ba69bfe7158cf2854e8ed4097)

Transcribed text:

viii
Session 7:   Iteration   Using While,   Repeat,   and   For
Algorithms   81
Iteration   81
While Loops   82
Repeat Loops   84
For Loops   85
Hands-On Looping Example   87
Summary   88
Problem Solving   88
Session 8:   The Type   Statement
The Notion of Data Type   91
The Type Statement   92
Subrange Types   93
Hands-On   Experiments with New Types   94
Examples of Subrange Types   95
Summary   96
Problem Solving   97
Session   9:   Text   Files   and   Printer   Output
What Is a File?   99
Kinds of Files   100
Declaring a Text File   101
Opening   a File   101
Closing a File   102
Hands-On   File   Output   102
Reading a Text File   104
General Forms of   1/0   104
The   Printer   105
Copy a File to the   Printer   106
Hands-On   Pseudo-File   1/0   106
Summary   108
Problem Solving   109
CONTENTS
81
91
99

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-1e5324a6d4bac78cdc7081ae80d3064c0b286b8ce40e02a5a4c10c79f759b9ba)

Transcribed text:

CONTENTS
-
-
-
-
-
Session 10:   Arrays
The Notion of an Array   111
Examples of Arrays   113
Tables   113
Hands-On Arrays   114
Lists   115
Add to the List   117
Sort the List   117
Look   Up   an Element in a List   120
Two-Dimensional Arrays   121
Summary   121
Problem   Solving   122
ix
111
Session 11:   String Processing   123
Strings in   Pascal   123
String Declaration   124
Length of Strings   124
The Difference Between String Size and String Length   125
Finding the Length of a String   125
Hands-On String Length   125
String Operations   127
Searching Strings   128
Looking for   Patterns   129
Deleting Substrings   130
More on   POS   131
An Improvement to the Hands-On   Program   131
Copy and Concat   132
Inserting Strings   134
Summary   134
Problem   Solving   134

Reading notes: Source is a table of contents with no primary heading; headline set to null.

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-a956434804b22a7f4a06dfec6b2dfa1ea66a5cd4bdafbadd7a17ac49cb1e1983)

Session 12: Data Structures Containing Records

Transcribed text:

x
Session 12:   Data Structures Containing Records
The Structure of Data   137
The Record Structure   138
Examples of Records   138
Dot Notation   139
Hands-On Experiment with   TIC..TOC   142
Nested Dots   143
The With Statement   143
Hands-On With Statements   146
Summary   147
Problem   Solving   148
CONTENTS
137
Session   13:   Sets and   Scalars   151
How Data Are Encoded   151
Enumerated Scalars   152
Hands-On Scalars   153
Examples of Enumerated Scalars   154
Sets   155
Examples   Using   Sets   156
Hands-On Sets   158
Things to Remember About Sets and Scalars   160
Summary   161
Problem   Solving   161
Session   14:   Random   and   Typed Files
Nontext Files   163
Sequential vs. Random Files   164
Random Files in Macintosh   Pascal   165
Constructing a Typed File   166
Reading a Typed File   168
Random Retrieval   168
Random File   Update   169
Hands-On Random Files   169
Summary   173
Problem   Solving   173
163

Reading notes: Page numbers and running headers are mixed into the extracted text, so reading order around them may be uncertain.

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/1#scan-62d8e62ff24e62914014b8bca71efa0b37875f2465822386db720966d919e826)

Transcribed text:

CONTENTS
-
-
-
-
Session 15:   More on Procedures   and   Functions   ·
Scope Rules   175
Spelling Anomaly   176
Side-Effect Anomaly   176
Nonlocal Objects   177
What Block Activation Does   179
Hands-On Blocks   180
Simple Scope Rules   183
Parameter Passing   183
Pass-by-Value   183
Pass-by-Reference   184
External Blocks   185
Recursion   185
Recursive Definition   186
Recursion in Pascal   186
Hands-On Recursive Function S(N)   187
When Not to   Use   Recursion   188
Forward Referencing   188
Summary   189
Problem Solving   190
Session   16:   Pointers   and   Dynamic   Data   Structures
Why Do We Need Dynamic Data Structures?   193
Addition Problem   193
Deletion Problem   194
Pointers   194
Nil Pointers   195
Operations on Pointers   196
Hands-On Linked Lists   196
Adding to Phonelist   198
Printing a   Phone   List   198
Hands-On Linked Lists Revisited   203
Deleting from Phonelist   203
Insertion in Phonelist   206
Summary   210
Problem Solving   211
xi
175
193

Reading notes: Headline not identifiable; source is a table of contents rather than advertising copy

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/b2b669dbe43136f82d5e1fe570776e9aad254aec73d0514e3e7cf6f3e26de173/Macintosh_Hands-On_Pascal_1986.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-macintosh-hands-on-pascal-1986-9144f0/2.md)
