← Introduction to Macintosh Pascal

Introduction to Macintosh Pascal

From the originals

23 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

HAYDEN Macintosh Library Apple Press Introduction to Macintosh™ Pascal Jonathan D. Simonoff

A book cover with a purple-to-magenta gradient background, a framed illustration of a beige Macintosh computer with keyboard and mouse sitting on a black starry shape against a cloudy blue sky with a crescent moon, and a pink wavy line across the middle.

Reading notes: The 'HAYDEN' and 'Macintosh Library' script text in the top banner is stylized and was transcribed as printed; the Apple Press logo text is small. Trademark symbol ™ after Macintosh in the title is transcribed as printed.

Languages
English
PDF page 1

Introduction to Macintosh Pascal

HAYDEN Macintosh Library Apple Press Introduction to Macintosh Pascal Jonathan D. Simonoff

A book cover with a purple-to-pink gradient background, a yellow top band with the HAYDEN Macintosh Library logo, a framed illustration of a beige Macintosh computer with keyboard and mouse set on a black starry pedestal against a cloudy sky with a crescent moon, and a pink wavy line crossing the sides.

Reading notes: The small 'TM' after 'Introduction to' and 'Macintosh' is a trademark mark and was transcribed as shown in the headline position only in the transcript context; its exact placement is slightly ambiguous. The top-right corner has a grey rectangular patch whose contents are not legible text. The author name is spaced letters and transcribed as 'Jonathan D. Simonoff'.

Printed product names
Macintosh Pascal
Languages
English
PDF page 2

Introduction to Macintosh™ PASCAL

A mostly blank off-white page with a bold black serif title in the upper right area followed by three horizontal magenta rules beneath it.

Reading notes: The trademark symbol after Macintosh is small and superscript; transcribed as ™.

Languages
English
PDF page 3

Introduction to Macintosli PASCAL Jonathan D. Simonoii [{] Hayden Book Company A DIVISION OF HAYDEN PUBLISHING COMPANY, INC. HASBROUCK HEIGHTS , NEW JERSEY I BERKELEY, CALIFORNIA

Reading notes: OCR rendering of 'Macintosh' appears as 'Macintosli'; 'Jonathan D. Simonoii' likely 'Simonoff' or similar Bracketed '[{]' mark uncertain

Languages
English
PDF page 4

Apple believes that good books are important to successful com- puting. The Apple Press imprint is your assurance that this book has been published with the support and encouragement of Apple Computer Inc., and is the type of book we would be proud to publish ourselves. Composition and production: TECHAlrr, SAN FRANCISCO Printed and bound by: COMMAND WEB OFFSET, INC. Cover design: JIM BERNARD Cover photo: WU ODOR Library of Congress Cataloging-in-Publication Data Simonoff, Jonathan D. Introduction to Macintosh Pascal. Includes index. 1. Macintosh (Computerl-Programming. 2. PASCAL (Computer program language) I. Title. QA76.8.M3S56 1985 005.265 85-24835 ISBN 0-8104-6562-0 Macintosh is a trademark of Macintosh Laboratory, Inc., licensed to Apple Computer Inc., neither of which is affiliated with Hayden Book Company. Macintosh Pascal is a trademark of Apple Computer Inc. Copyright © 1985 by Jonathan D. Simonoff. All rights reserved. No part of this book may be reprinted, or reproduced, or utilized in any form or by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying and recording, or in any information storage and retrieval system, without permission in writing from the Publisher. Printed in the United States of America 1 2 3 4 5 6 7 8 9 Printing 85 86 87 88 89 90 91 92 93 Year

Reading notes: Primary heading not explicitly printed in the supplied copy; headline set to null Library of Congress call number and ISBN appear in fine print; some OCR spacing irregular

Printed product names
Macintosh Pascal
Printed dates
1985 · 85-24835 · 1 2 3 4 5 6 7 8 9 Printing · 85 86 87 88 89 90 91 92 93 Year
Languages
English
PDF page 5

Preface Introduction to Macintosh Pascal was written to provide an easy-to-follow introduction to programming, to programming in Pascal, and to programming the Macintosh. It is based on the idea that programming is learned best by examining and creating real programs that solve real problems. Programming is often surrounded with an unnecessary and misleading sense of mystery. Learning to program is really a skill on the order of learning how to write a term paper-with the additional advantage that the computer never writes snide comments in the margin, and never delivers a grade at the end of the semester. Although a book may have a single name on its cover, all books are the sum of the efforts of many people. I would especially like to thank Susan Keohan, without whose encouragement nothing would have been written, and without whose help nothing would have been finished. Thanks also to Andrew Singer of Think Tuchnologies; Chris Espinosa of Apple Computer; and Marjorie Lefkowitz and Eben Sprinsock for their great help in testing and verifying the book and its programs. Thanks for any errors, of course, lie only with myself.

Reading notes: Possible misprint 'Tuchnologies' for 'Technologies' in acknowledgments

Printed product names
Macintosh Pascal
Languages
English
PDF page 6

Contents Chapter 1 Can I Be an Artist if I Can't Draw a Line? 1 Starting Macintosh Pascal 1 Writing a Program 4 Editing a Program 15 Finishing Up 16 Chapter 2 Lining Up 23 Variables and the Mouse 23 Functions 29 Giving Feedback 33 Changing the Mac's Pen 36 Writing Your Own Procedures 37 Writing Your Own Functions 40 TRUE and FALSE Expressions 45

Languages
English
PDF page 7

Chapter 3 Rectangles and Ovals 51 Drawing a Rectangle 51 Drawing More Shapes 62 All About the Macintosh Pen 80 Chapter 4 What fype Through Yonder Window Breaks 91 Machintosh Text 91 Fonts 99 Faces 103 Size 108 Transfer Mode 112 A Simple Editor 116 Storing Text 123 Chapter 5 Fielding 139 Developing a One-Field Editor Program 139 Enumerated Data fypes 142 Global and Local Coordinates 143 Creating Onscreen Buttons 145 Defining the Drawing Window 147 Sizing the Editing Field 148 Displaying the Editing Field 150 Edi~ing Procedures 151 Results of Field Editor 160 Developing a Multiple Field Editor 160 Chapter 6 Files: A Piece of Cake 177 File Variables 178 File Procedures 179 Modifying the Multiple Field Editor 182 Creating the Basic Framework 200 Sorting 207

Reading notes: Table-of-contents style listing with OCR-like damage such as 'fype' for 'Type' and 'Machintosh' for 'Macintosh'. Reading order of chapter headings and subsections may be uncertain due to layout loss.

Printed product names
Macintosh
Languages
English
PDF page 8

Chapter 7 Sound Synthesis 221 A Little Theory 222 The Practical Side 226 A Simple Program 227 Dialing a Telephone 228 Pointers and Normal Variables 230 Chapter 8 Printing 253 Chapter 9 Advanced QuickDraw 263 Polygons 265 Pictures 268 Regions 273 Cursors 274 Bitmaps 280 Patterns 285 Chapter 10 Macintosh Math 291 Math on the Macintosh 291 The Importance of Data Types 292 Variable and Constants 292 Numbers 2~3 Precision 293 Integer Data Types 293 INTEGER 294 LONG INT 294 Real Data Types Expressions 298 Operators 299 Unary Numbers 299 Boolean Expressions 300 Relational Operators 301 Relational Expressions and Real Numbers 302 Operator Precedence 304 Functions 305 Standard Functions 306 Fixed Point Functions 315

Reading notes: Source is a table of contents with some broken tokens such as 'Numbers 2~3' and split words like 'Real Data Types' and 'Operator Precedence'. No primary heading is explicitly printed, so headline is null.

Languages
English
PDF page 9

Chapter 11 Debugging What is a Bug? When the Macintosh Catches a Mistake Programming to Avoid Bugs Finding Bugs Machintosh Pascal Debugging Aids Stepping Through a Program The Instant Window Stops The Observe Window When You Can't Use the Debugging Aids General Debugging Hints Bugs in the Macintosh Appendices Appendix A AppendixB Index Everything About Semicolons Help, Please, My Mac is Burning 319 319 320 321 323 323 323 323 325 32'7 328 329 330 333 339 345

Reading notes: Page number '32'7' may be an OCR error for '327'

Languages
English
PDF page 10

Introduction The Educated Macintosh The subjects covered in this introduction are: • What Macintosh Pascal is • What you need to use this book • How to set up your Macintosh Pascal disk for this book • How to use this book What Is Macintosh Pascal? A computer is a machine for following instructions. When you give instructions to a computer, the instructions have to be in terms the computer can understand. When you write out some instructions for the computer, those instructions are called a program. Sets of allowable computer instructions are called computer languages. Pascal is one of the most popular computer languages. Pascal was designed to be easy to learn and to help the programmer to program well. The Macintosh Pascal language is a version of Pascal that includes everything in "standard Pascal;' and also lets you use all those things that make the Macintosh such a special computer. In particular, you can use the fast, high quality graphics and the sound generator.

Printed product names
Macintosh Pascal
Languages
English
PDF page 11

Introduction to Macintosh Pascal

Introduction to Macintosh Pascal Tu understand what makes Macintosh Pascal really special, you have to know what it is like to program in most versions of Pascal. Usually, you write a program using an editor. When you are done, you run a program, called a compiler, to translate your program for the computer. If your program has any mistakes, the compiler gives you a list of them, and then you run the editor again, and fix the mistakes. When you compile the program without mistakes, you run another program, called a linker, which creates a version the computer can use. Macintosh Pascal, though, is an interpreter. You write your program, and then choose a menu command to run it. If you have a mistake, a little hand points at the line with the mistake. You can then fix the mistake, and run your program again. If you want to see the effect of some change, you just make the change, and you see the effect right away. It is that "instant" quality of Macintosh Pascal that makes the Macintosh Pascal language an ideal learning language. What You Need To Use This Book To use this book, you must have: • A disk copy of Macintosh Pascal (This must be an authentic, authorized copy. Because of the protection scheme used, "bootleg" copies will fail after a few minutes.) • An Apple Macintosh or Macintosh XL (or Lisa) with MacWorks XL • A blank disk This book works for any Macintosh. The programs will all work with 128K of memory (the smallest Macintosh available), but more memory will make it easier for you to write your own programs. The book assumes you have a single (internal) disk drive. A second (external) disk drive also makes things easier, but it is not necessary. If you use this book with a Macintosh XL, everything except for the programs that use the Mac's sound generator (Chapter 6) will work.

Reading notes: Initial word 'Tu' appears to be a possible OCR or typographical variant of 'To'.

Printed product names
Macintosh Pascal · Macintosh XL · MacWorks XL · Lisa
Languages
English