# The MacPascal Book — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/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-the-macpascal-book-1985-9181e1/1#scan-34aa2a3d41b988d7a3d476b0fb04de4de6622cce28e9eb7608afab9d2e0e9d2b)

The MacPascal Book

Transcribed text:

The
MacPascal Book

Paul Goodman
Alan Zeldin

Brady

Image description: A blue-toned book cover with a green and black top band, a stylized Macintosh computer with keyboard and mouse in the center, and a large red apple graphic on the right, with the title in red-outlined white letters.

Reading notes: Small publisher logo 'Brady' at lower left is stylized and may be read with some uncertainty. Author names at lower right are stylized in red italic and read as 'Paul Goodman' and 'Alan Zeldin'.

Printed product names: MacPascal

Languages: English

[Original Image 1](https://www.vintageapple.net/files/8584f8d89312850ead1b7263b4e477e8da1321d8ba526cd173032d26eb191b3a/a0bf04e5a7cb0c1e659c3d8e.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-c94428456fa8f274d70e2ebc233ea2bf41405452d4c150cea43238d5efeeff66)

Transcribed text:

The MacPascal Book

Brady

Paul Goodman
Alan Zeldin

Image description: A book cover with a green and black textured background, a large red-outlined title, and a stylized illustration of a Macintosh-style computer with keyboard and mouse in front of red apples, all in a blue striped scanline treatment.

Reading notes: Publisher logo 'Brady' and author names are small and stylized but legible; reading order follows title, publisher, then authors.

Printed product names: MacPascal

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-9a085cdbf82dc97c85fd0503f0fa09e562b59ae0e351b77dc3362f08a759f075)

Transcribed text:

The MacPascal Book

Image description: A plain cream-colored page with the bold sans-serif title 'The MacPascal Book' in the upper left, a handwritten letter 'B' and two slash marks at the top right edge, and otherwise blank.

Reading notes: Faint, nearly invisible marks may exist in the central area of the page but no further text could be confirmed. Handwritten 'B' and slash marks at top are not transcribed as printed text.

Printed product names: MacPascal

Languages: English

[Original PDF page 2](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-e6da78db5e69282e1403bba1d861288b71c099f3b109ebf9d5261949cc0f4949)

Transcribed text:

Publishing Director: David   Culverwell
Acquisitions Editor:   Susan   Love
Production Editor/Text Design: Roberta   Glencer
Art Director/Cover Design: Don   Sellers
Assistant Art Director: Bernard Vervin
Manufacturing Director: John Komsa
Typesetter:   Shepard   Poorman Communications,   Indianapolis,   IN
Printer: R. R. Donnelley   &   Sons,   Harrisonburg,   VA
Typefaces:   Paladium   (text), CG Frontiera   (display),   News Gothic (programs)

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-4fd5cd93d6da90191bfc482f650b01c3d7bc1163645d69bcc48773ed01c8cf28)

The MacPascal Book

Transcribed text:

The   MacPascal   Book
Paul   Goodman
Alan   Zeldin
Brady   Communications   Company,   Inc.
A   Prentice-Hall   Publishing   Company
Bowie,   Maryland   20715

Printed product names: MacPascal

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-78818b2dabfc58b8323119daf1a04187c3a248646e85dd8d920c2fe20f3de2fe)

The MacPascal Book

Transcribed text:

The   MacPascal   Book
Copyright   © 1985 by Brady Communications Company, Inc. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or by
any means, electronic or mechanical, including photocopying and recording, or by
any information storage and retrieval system, without permission in writing from
the publisher. For information,   address   Brady Communications Company, Inc.,
Bowie, Maryland   20715.
Library of Congress Cataloging In Publication Data
Goodman,   Paul.
The MacPascal book.
Bibliography: p.
Includes index.
1. Macintosh (Computer)-Programming. 2.   PASCAL   (Computer program lan-
guage)   I.   Zeldin,   Alan. II. Title.
QA76.8.M3G661985   001.64'2   85-431
ISBN   0-89303-644-7
Prentice-Hall of Australia,   Pty.,   Ltd.,   Sydney
Prentice-Hall Canada, Inc.,   Scarborough,   Ontario
Prentice-Hall Hispanoamericana,   S.A.,   Mexico
Prentice-Hall of India Private Limited,   New Delhi
Prentice-Hall International   (UK)   Limited,   London
Prentice-Hall of Japan, Inc.,   Tokyo
Prentice-Hall of   Southeast   Asia   Pte.   Ltd.,   Singapore
Editora Prentice-Hall Do Brasil LTDA.,   Rio de Janeiro
Whitehall Books, Limited,   Petone,   New   Zealand
Printed in the   United   States   of America
85 86 87 88 89   90   91 92 93 94 95   12345678910

Reading notes: Running spacing in the copyright and cataloging lines is irregular, so some word boundaries may be approximate. The ISBN and call number digits are reproduced as printed and should be checked against the original.

Printed product names: MacPascal

Printed dates: 1985 · 85-431 · 85 86 87 88 89 90 91 92 93 94 95

Languages: English

[Original PDF page 5](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-fd85b837d9f323a1617cebd9767f920b013eac212f4b76f892313561bc508575)

Transcribed text:

Contents
1 Computer Concepts   I   1
Hardware   I   1
Software   I   4
Language Translators   I   4
Interpreters and Compilers   I   5
The Operating   System   I   5
The Macintosh   I   5
Macintosh Software   I   6
2   Using   MacPascal   I   7
Getting   Up   and Running   I   7
Editing a Program   I   13
Saving   a Program   I   14
Recalling a Program   I   15
Printing a Program   I   16
Printing the Active Window   I   17
3   Pascal   Fundamentals   I   19
Syntax   I   19
Documenting a Program   I   22
Write and Writeln   I   23
Data   I   26
Data Types   I   26
Variables   I   29
Assignment Statements   I   31
More on Write and Writeln   I   33
Expressions   I   35
Operator Precedence   I   39
Constants   I   40
Read and Readln   I   42
Review of Program Structure and   Some   Examples   I   44
The Perimeter and Area of a Rectangle   I   44
Converting Temperatures   I   45
Exercises   I   46
4   Pascal   Structures   I   47
The Boolean Data Type   I   47
Boolean Operators   I   47
Boolean Expressions   I   48
IF-THEN   I   49
Compound Statements   I   52
IF-THEN-ELSE   I   53
v

Reading notes: Source is a table of contents, not an advertisement; no prices or dates are printed Some headings contain extra spacing that may reflect layout rather than original text

Printed product names: MacPascal · Macintosh

Languages: English

[Original PDF page 6](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-8c3d2dd14f172fe33fa1059693fa0903431771e67a06a17228a7219270e0efc4)

Transcribed text:

Nested IF Statements   I   55
FOR   Loops   I   56
DOWNT0/61
Calculating Interest Compounded Daily   I   61
The Summation of an Infinite Series   I   63
The WHILE Loop   I   64
Sentinals   I   67
The Break Even   Point   I   68
Controlling the Text Window   I   68
The Macintosh Screen   I   69
Introduction to Graphics   I   71
Exercises   I   7 4
5 Debugging a   MacPascal   Program   I   77
The Nature of a MacPascal   Program   I   77
Execution Modes   I   78
Syntax Errors   I   79
Undeclared Identifiers   I   81
Execution Errors   I   81
Run Time Errors   I   81
Logic Errors   I   81
The   Observe   Window   I   82
Setting Break   Points   I   83
The Instant Window   I   84
6 More on Data Types   I   85
The Char Types   I   85
Ordinal   Types   I   86
The   ORD   and CHR Functions   I   86
The   SUCC   and   PRED   Functions   I   88
Other   Built-In Functions   I   88
The Conversion Functions-TRUNC and   ROUND   I   88
More on Reals and Integers   I   89
The Longint Data Type   I   89
The Extended Real Types   I   90
The Arithmetic Functions   I   91
The Trigonometric Functions   I   92
The   Logarithmic   Functions   I   93
Tool Box Functions   I   93
User-Defined Data Types   I   94
Subranges   I   96
Drawing   Ovals   I   98
Exercises   I   101
vi

Reading notes: Source appears to be a table of contents with OCR artifacts such as 'DOWNT0/61' and 'Sentinals' that may be misspelled or misread. Page numbers and dotted leaders are interleaved with section titles, so reading order is uncertain.

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-4cbddf4639d279ab173ac861412396a5a01f61d59cbdea0eb31e59c1a92c03dc)

Transcribed text:

7   Procedures   I   103
Scope   of Variables   I   106
Parameter   Passing   I   109
Variable Parameters   I   111
The Major Advantage   I   113
Value   Parameters   I   113
Comparing Value and Variable   Parameter   Passing /   115
Mixing Variable and Value   Parameters   I   116
Mortgage Calculator   I   117
Drawing   Lines   I   120
Exercises   I   123
8 Arrays and Strings   I   125
Sentinels   I   128
Two-Dimensional Arrays   I   130
Arrays of Characters   I   142
The Code Breaker   Program   I   144
Strings   / 145
Reading a   String   I   146
Comparing   Strings   I   147
The   String   Functions and   Procedures   I   147
The Length Function / 147
The Concat Function   I   147
The   Pos   Function   I   148
The Copy Function   I   148
The Delete   Procedure   I   148
The   Omit   Function   I   148
The Insert   Procedure   I   149
The Include Function   I   149
Exercises   I   149
9 More   On   Structures   I   151
The Repeat Loop   I   151
The Bubble   Sort   I   153
The Case   Statement   I   154
User-Defined   Functions / 157
Recursion   I   159
Records   I   165
The With   Statement   I   168
Duplicate Field Names   I   169
Arrays of Records /   170
Nested Records   I   173
Time and Date Operations / 175
Sets   / 176
vii

Reading notes: Source appears to be a table of contents with page numbers; no advertised products, prices, or dates are present.

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-8a486b6cdc8453bb0038a321c2c5eeee97a791768ffff9dc4fa34895ddb171e1)

Transcribed text:

Set   Operators   I   177
Set   Union   I   177
Set   Difference   I   177
Set   Intersection   I   178
Exercises   I   180
10   A Formal Look at Graphics   I   185
Points   I   185
Drawing Lines   I   186
Rectangle   I   187
Controlling the Drawing Window   I   189
Drawing Rectangles   I   190
Other   Shapes   I   191
The   Pen   I   192
The Mouse   I   195
The Cursor   I   197
Sketchpad   I   197
A New Feature   I   199
Displaying Text on the Drawing Window   I   199
Calculations with Rectangles   I   202
Implementing the New Feature   I   203
Playtime with Quick Draw   I   205
Exercises   I   210
11 Files   I   213
The File Buffer   I   215
Using   Files   I   215
Opening Files   I   216
Accessing Files   I   217
Closing a File   I   218
Mixing Get and   Put   I   219
Using   Random Access Files   I   219
Seek   I   220
Finding the End of a File   I   221
Text Files   I   221
12 Variant Records and   Pointers   I   233
Variant Records   I   233
Pointers   I   236
13 A Look at an Application-The Checking and Savings   Program   / 243
Overview   I   243
Data Structures   I   244
Development   I   245
viii

Reading notes: Source appears to be a table of contents with page numbers; headline not identifiable as a primary heading.

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-63630756852e93b2ae5cdbe8cae328e3ecb1006de14d566cc5175d19a3873d56)

Transcribed text:

Appendices   I   267
A Selected Exercise Answers   I   268
B Menu   Summary   I   270
C Documenting a   Program   I   275
D   Sound   and Music   I   284
E Differences Between   MacPascal   and   UCSD   Pascal   I   289
F   MacPascal   Reserved Words   I   292
G   MacPascal   Syntax   Diagrams   I   293
H List of QuickDraw Routines   I   308
I List of   Sane   Functions and   Procedures   I   314
J   MacPascal   Error Messages   I   317
K Bibliography   I   323
L The Macintosh Character   Set   I   325
Index   I   327
ix

Reading notes: Table of contents page with no explicit headline or advertised products; headline set to null

Printed product names: MacPascal · UCSD Pascal

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/1#scan-8bf19fad6ff5564f7d553c08e818d523f21ee0eea7f2da7021867d3e06ea93bf)

Transcribed text:

Limits of   Liability   and   Disclaimer   of
Warranty
The author(s) and publisher of this book have used their best efforts in preparing
this book and the programs contained in it. These efforts include the development,
research, and testing of the theories and programs to determine their effectiveness.
The author(s) and publisher make no warranty of any kind, expressed or implied,
with regard to these programs or the documentation contained in this book. The
author(s) and publisher shall not be liable in any event for incidental or consequen-
tial damages in connection with, or arising out of, the furnishing, performance, or
use of these programs.
Note to Authors
Have you written a book related to personal computers? Do you have an idea for
developing such a project?   If   so, we would like to hear from you. Brady produces a
complete range of books for the personal computer market. We invite you to write
to David Culverwell, Publishing Director, Brady Communications Company, Inc.,
Bowie, MD   20715.
Registered Trademarks
Macintosh is a trademark licensed by Apple Computer, Inc.
MacWrite is a registered trademark of Apple Computer, Inc.
x

Printed product names: Macintosh · MacWrite

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/70f0cb0a9a438ac050abc3ab7155acd6dccd7c4fb33cce281d4af9b68a2adf42/The_MacPascal_Book_1985.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-the-macpascal-book-1985-9181e1/2.md)
