← Oh! Macintosh Pascal! (supplement to Oh! Pascal!)

Oh! Macintosh Pascal! (supplement to Oh! Pascal!)

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

Oh! Macintosh Oh! Pascal! George Beekman / Michael Johnson Oh! [illegible] by Doug Co[illegible] CORNELL CAMPUS STORE 0-393-9559[illegible] CSCI [illegible]INTOSH PA 127 [illegible]EKMAN 705

A book cover with a torn grey-to-white top corner showing a large blue Oh! title, a black hand-drawn speech bubble containing blue handwritten Macintosh, a central bold black title Oh! Pascal!, and a large blue stippled sculptural illustration of a head-like form with a Cornell Campus Store sticker at lower left.

Reading notes: Top-left title is partly torn and obscured, so only Oh! and by Doug Co... are partly visible. Sticker text at lower left is partially covered and cut off, including the ISBN-like number and the author name fragment. The handwritten word Macintosh is inside a speech bubble and its reading order relative to the title is ambiguous. Partial black yellow label fragment at left edge is unreadable.

Printed product names
Oh! Pascal! · Macintosh
Languages
English
PDF page 1

Oh! Macintosh Oh! Pascal! George Beekman / Michael Johnson Oh! by Doug Co... (partially obscured) CORNELL CAMPUS STORE ...-393-9559 CSCI ...INTOSH PA 127 ...EKMAN 705

A book cover with a large blue-and-white stylized helmeted figure made of blocky shapes, a black speech-bubble outline containing handwritten blue 'Macintosh' text, a torn grey top-left corner revealing a blue 'Oh!' title fragment, and a Cornell campus store sticker with a barcode at lower left.

Reading notes: Top-left blue title and author line are cut off by the torn grey panel; only 'Oh!' and 'by Doug Co...' are visible. Campus store sticker text is partially covered by the sticker's tape and the artwork; phone number and course/author fragments are uncertain. The handwritten 'Macintosh' in the speech bubble is script, not printed type, and is transcribed as shown. Reading order of the cover elements is approximate; the sticker numbers are fragmentary.

Printed product names
Macintosh
Languages
English
PDF page 2

The image is a plain, entirely blank white page with no artwork, layout elements, or markings visible.

Reading notes: No visible text or imagery found; transcript and printed fields left empty.

PDF page 3

The image is a plain, entirely blank white page with no artwork, layout elements, or markings visible.

Reading notes: No visible text or imagery was found in the scan, so all printed fields are empty.

PDF page 4

The image is an entirely blank white page with no visible artwork, layout, or printed content.

Reading notes: No visible text found; image appears blank white.

PDF page 5

!1J This book was designed and typeset by George Beekman and Michael Johnson using a Macintosh Plus and an Apple LaserWriter printer. ©Copyright 1986 by W.W. Norton & Company, Inc. ISBN 0-393-95598-2

Reading notes: Leading characters '!1J' before the first line are unclear and may be damaged or stray marks.

Printed product names
Macintosh Plus · Apple LaserWriter
Printed dates
1986
Languages
English
PDF page 6

Table of Contents Preface vii A Word to the Student ix 1 Getting Acquainted with Macintosh Pascal 1 What is Mac Pascal? 1 Programming for Output 2 Variables and Input 3 Antibugging and Debugging 4 2 Programming Calculations and Graphics 7 Assignments and Expressions 7 Built-In Functions and Procedures 8 Introducing QuickDraw Graphics 9 3 Procedures and Functions for Problem Solving 17 Functions as Subprograms 17 Antibugging and Debugging 17 4 Taking Control of Execution: the for Statement 21 for Statements and Program Actions 21 One-Dimensional Arrays* 22 5 Making Choices: the case Statement 24 The case Statem~nt 24 6 Programming Decisions: the if Statement 29 boolean Expressions and If statements 29 7 Making Actions Continue: The Conditional Loops 30 The repeat and while statements 30 Antibugging and Debugging 32 8 Character-Oriented Computing: Text Processing 33 Text Processing 33 The File Window and External Files* 37 9 Extending the Ordinal Types 43 Enumerated Ordinal Types 43 v

Reading notes: Possible OCR error in 'case Statem~nt' and 'The case Statem~nt' near chapter 5 heading.

Printed product names
Mac Pascal
Languages
English
PDF page 7

Table of Contents 10 Software Engineering 44 Writing Programs for People 44 11 Arrays for Random Access 46 Focus on Programming: Arrays 46 Strings as Arrays 50 12 E Pluribus Unum: Records 53 Predefined Record Types 53 13 Files and Text Processing 56 Making and Using Textfiles 56 Direct Access Files 58 Antibugging and Debugging 64 14 Collections of Values: The set Type 66 Defining and Programming SetTypes 66 15 Abstract Data Structures Via Pointers 67 Pointers in Macintosh Pascal 67 16 Advanced Topics 68 Macintosh Pascal Extensions 68 Advanced Programming Resources 70 Beyond Macintosh Pascal 71 Appendix: A Hands-On Introduction 73 Session 1: Meet Mac Pascal (to accompany Chapter 1) 73 Session 2: Tools and Tricks (to accompany Chapter 2) 87 Error Messages and Explanations Inside back cover Macintosh Desktop Command Summary Reference card Macintosh Pascal Functions and Procedures Reference card vi

Reading notes: Source is a table of contents; no advertised products, prices, or dates are present as advertising copy. Primary heading not explicitly identified in the supplied text.

Printed product names
Macintosh Pascal
Languages
English
PDF page 8

Preface Ohl Pascall is an exceptionally readable, thorough, and educationally sound introduction to Pascal programming and problem solvin~. When we first adopted Ohl Pascall at Oregon State in 1982, we were usmg an aging CDC mainframe running an antiquated version of Pascal. In 1985 we moved our introductory programming classes onto a bushel of shiny Macintoshes. The course will never be the same. The Macintosh Pascal interpreter, with its graphic user interface, smart editor, multiple windows, and powerful debugging options, provides a nearly ideal environment for teaching beginning programming. Our switch to Macintosh Pascal created one problem: textbook incompatibility. Ohl Pascall teaches Standard Pascal, a language that only roughly resembles implementations used on most of today's microcom- puters. String data types, direct access files, and graphics - all common in microcomputer versions of Pascal - aren't included in the original Pascal Standard - or the Cooper and Clancy text. Many features that were included in the Standard have been modified and improved in Mac Pascal. these changes make Pascal easier to use and more powerful, but they're hard to teach without a supporting text. There are at least a dozen Macintosh Pascal books on the market, but Ohl Pascall provides a far better introduction to Pascal, programming, problem solving, and computer science than any of these Mac-specific alternatives. Rather than settling for a book that com_promises on Pascal in order to focus on the machine environment, we decided to start with the best available Pascal textbook and develop a bridge between that book and the Macintosh environment. Ohl Macintosh Pascall is that bridge. It includes: • A gentle hands:..on introduction to the Macintosh Pascal programming environment. • Topic-by-topic discussions of the differences between Standard Pascal and Macintosh Pascal. • Thorough introductions to the most important special features of Mac Pascal, including string processing, file manipulation, and graphics. • A wealth of programming examples in Macintosh Pascal. • Supplementary exercises for Mac Pascal programmers. • A reference section including explanations of common error messages. • A tear-out quick reference card. vii

Reading notes: OCR-like damage in terms such as "Ohl" and "Pascall" and "usmg", and "com_promises"; uncertain spelling of the book title. Heading is "Preface" and reading order of bullet list is clear.

Printed product names
Macintosh Pascal · Mac Pascal · Standard Pascal
Printed dates
1982 · 1985
Languages
English
PDF page 9

Acknowledg- ments Preface • An optional supplementary disk containing all of the programs in 0 hf Macintosh Pascal!, many of the programs in Ohl Pascal!, and bonus programs that illustrate with Macintosh graphics some important programming concepts from the text. Oh! Macintosh Pascal! is designed to accompany Oh! Pascal! Topics are generally covered in the same sequence. And like Oh! Pascal!, this supplement need not be read in a strict sequential order. Some instructors, for instance, may want to cover the section on using external files earlier than Chapter 8 so they can use data files in their programming assignments. We are careful to introduce Macintosh Pascal's special features where they'll fit most appropriately in an introduction to Pascal. Strings and graphics, for example, come early because they provide powerful, interesting, and understandable tools for learning about procedures and functions. We're interested in hearing of your experiences with Oh! Macintosh Pascal! We can be reached on CSNET at Oregon State (beekman@orstcs, mpj@orstcs) or by good old-fashioned US Mail in the Computer Science Department at Oregon State University, Corvallis, OR 97330. First, thanks to Doug Cooper and Michael Clancy, whose excellent book inspired this effort. We particularly appreciate Doug's encouragement and advice in the early stages of this project. On the editorial end, it's been a pleasure working with Jim Jordan and his staff at W.W. Norton & Co; their fine editing and professional support made our work much easier - and this book much better. We also appreciate the help and information we received from Anjali Magana and the friendly folks at Apple Computer. Locally, we are especially indebted to Karen Meyer-Arendt, Mark Borgerson, Susan Beekman, and Kathy Johnson for their many editorial contributions to this text. And finally, to our families - who have endured so much and seen us so little over the last few months - love and thanks. viii George Beekman Michael Johnson October, 1986

Reading notes: Acknowledgments heading is hyphenated across lines as 'Acknowledg-ments' in the source.

Printed product names
Oh! Macintosh Pascal! · Oh! Pascal!
Printed dates
October, 1986
Languages
English
PDF page 10

A Word to the Student

A Word to the Student Learning Mac Pascal identifiers (4) Preface You may be wondering why you've been assigned a separate book on the subject of Macintosh Pascal. The answer is that you're lucky.. .lucky to be learning Pascal on a system that's more interesting (and fun) than the kind of computer system for which the textO hf Pascal! - and the original Pascal language - were conceived. Because you'll use the Macintosh to learn programming, you'll also learn a different - and much easier - way of working with a computer than the one assumed in Oh! Pascal! Oh! Macintosh Pascal is your guide to the special features of the Macintosh system; it's an essential supplement to the text. Oh! Pascal! describes what is regarded by the International Standards Organization (ISO) as the Pascal Standard, and every program in Oh! Pascal! is a Standard Pascal program. All Standard Pascal programs can be run using Macintosh Pascal (occasionally with minor modifications, as discussed in this supplement). However, since Macintosh Pascal is designed to allow you to write programs that take advantage of the Macintosh computer's special features and capabilities - like its graphics and sound generation hardware - not every program you'll write in Macintosh Pascal will be a Standard Pascal program. The two main objectives of Oh! Macintosh Pascal! are to make clear which elements of Macintosh Pascal are different from Standard Pascal, and to explain the special features of Mac Pascal that you need to know about to be fully conversant with the Macintosh. . You'll find learning Mac Pascal easier if you follow these procedures: 1. Read your assignment in Oh! Pascal! That's where you'll learn the nuts and bolts of programming, problem solving, and Standard Pascal. 2. Read the corresponding chapter in Oh! Macintosh Pascal! for details of your brand of the language. Each chapter contains notes that modify or expand on statements made in the text. For example, when Oh! Pascal! tells you on page 4 that a Standard Pascal identifier may contain any series of letters or digits, Oh! Macintosh Pascal! adds that it's OK in Macintosh Pascal to include underscore characters in identifiers. Marginal sideheads with parenthesized page references, like the one to the left of this paragraph, make it easy to find the corresponding passages in Oh! Pascal! For sideheads that deal with Macintosh-specific topics that aren't covered in 0 hf Pascal!, we substitute a tiny Macintosh for the page reference number. How you read these notes will depend on your personal learning style. Most readers prefer to make an uninterrupted pass through each chap- ter of Oh! Pascal! before consulting Oh! Macintosh Pascal! Some read the two books side by side from ·the beginning, checking for notes and additions as they go along. A few read it both ways. Have 1t your way.... 3. Get your hands dirty. Leaming to program is like learning to ride a bicycle; you can't do it without doing it. The two-part tutorial in the appendix is designed to get you up and running on the Macintosh quickly and painlessly. Work through these tutorial sessions after reading Chapters 1 and 2, respectively. But don't stop there. Do the exercises. Try out program examples from the text, the supplement, and the Oh! Macintosh Pascal! diskette. Experiment. Have fun! ix

Reading notes: Garbled OCR in 'textO hf Pascal!' and 'Oh! hf Pascal!' page-title fragments Marginal sideheads and reading order may be jumbled in the OCR text

Printed product names
Macintosh Pascal · Oh! Pascal! · Oh! Macintosh Pascal!
Languages
English
PDF page 11

The White Rabbit put on his spectacles. "Where shall I begin, please your majesty?" he asked. "Begin at the beginning," the king said, very gravely, "and go on till you come to the end: Then stop." -Lewis Carroll Alice in Wonderland

Languages
English