← The MacPascal Book

The MacPascal Book

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

The MacPascal Book

The MacPascal Book Paul Goodman Alan Zeldin Brady

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
PDF page 1

The MacPascal Book Brady Paul Goodman Alan Zeldin

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
PDF page 2

The MacPascal Book

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
PDF page 3

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
PDF page 4

The MacPascal Book

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
PDF page 5

The MacPascal Book

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
PDF page 6

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
PDF page 7

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
PDF page 8

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
PDF page 9

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
PDF page 10

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
PDF page 11

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