← Turbo Pascal for the Mac: A Quick Path to Programming Power

Turbo Pascal for the Mac: A Quick Path to Programming Power

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

TURBO PASCAL for the MAC

Brady Paul Goodman & Alan Zeldin TURBO PASCAL® for the MAC® A Quick Path to Programming Power

A book cover with a blue background showing white serif title text and a painted green, teal, and dark navy abstract landscape band across the lower portion, framed on a gray backdrop with a Brady logo in the top-left corner.

Reading notes: The 'Brady' logo in the top-left corner is partially cropped at the edge of the image. Registered trademark symbols after PASCAL and MAC are small and rendered as ® characters.

Printed product names
Turbo Pascal for the Mac
Languages
English
PDF page 1

TURBO PASCAL for the MAC

Brady Paul Goodman & Alan Zeldin TURBO PASCAL® for the MAC® A Quick Path to Programming Power

A book cover with a blue background, white serif and sans-serif title text, and a painterly green, teal and dark blue abstract landscape band across the bottom, with a gray border and a black 'Brady' publisher logo in the top left corner.

Reading notes: The 'Brady' logo at top left is partially cut off at the edge of the scan. Registered trademark symbols after PASCAL and MAC are small and rendered as ® in the transcript.

Printed product names
Turbo Pascal for the Mac
Languages
English
PDF page 2

® ® Turbo Pascal for the Mac A Quick Path to Programming Power Paul Goodman Alan Zeldin A Brady Book New York, New York 10023 ..s-

Reading notes: Transcript is intentionally empty because the exact extracted text is preserved separately. Fields were filled only from the supplied copy, so the visual description and layout are inferred from text alone. The ® symbols and the fragment '..s-' are uncertain and could not be confirmed visually. '10023' appears to be a ZIP code, not a printed date, and was not listed as a date. No prices or explicit publication year are present in the supplied copy.

Printed product names
Turbo Pascal for the Mac
Languages
English
PDF page 3

Copyright © 1988 by Paul Goodman and Alan Zeldin. All rights reserved including the right of repro- duction in whole or in part in any form BRADY Simon & Schuster, Inc. Gulf + Western Building One Gulf + Western Plaza New York, New York 10023 DISTRIBUTED BY PRENTICE HALL TRADE Manufactured in the United States of America 10987654321 Library of Congress Cataloging-in-Publication Data Goodman, Paul, 1958- Turbo Pascal for the MAC: a quick path to programming power Paul Goodman, Alan Zeldin. p. cm. "A Brady book." Bibliography: p. Includes index. ISBN 0-13-933011-9 1. Macintosh (Computer)-Programming. 2. PASCAL (Computer program language) 3. Turbo Pascal (Computer program) I. Zeldin, Alan, 1957- . II. Title. QA76.8.M3G664 1987 005.265-dc19 -

Reading notes: Publisher imprint and address lines are partially fragmented in the source text, so reading order near the copyright block is uncertain.

Printed product names
Turbo Pascal · Macintosh
Printed dates
1988 · 1958 · 1957 · 1987
Languages
English
PDF page 4

CONTENTS Preface ix Introduction xi 1. Turbo Pascal for the Macintosh 1 Why Turbo Pascal? 1 Macintosh Overview 2 Why This Book? 4 Starting Up 4 Running a Program 7 Editing a Program 10 Printing a Program 13 Printing the Active Window 13 The Macintosh Screen 14 Chapter Summary 15 2. Turbo Pascal Fundamentals 17 Introduction 17 A First Program 17 Syntax 18 More on Identifiers 20 Comments 21 Documenting a Program 21 Write and Writeln 23 Trial and Error-Semicolons 24 Data Types 26 Variables 28 Trial and Error-Improper Data 30 Run-Time Errors 30 iii

Languages
English
PDF page 5

TuRBo PASCAL FOR THE MAC

iv TuRBo PASCAL FOR THE MAC Assignment Statements 31 Expressions 32 Operations 34 Mixing Data Types 35 Operator Precedence 36 Constants 37 More on Write and Writeln 38 Read and Readln 40 Review of Program Structure 41 The Dirty Dozen-The Most Likely Syntax Errors 42 3. Pascal Structures 49 Introduction 49 Decision Making-If-Then 49 The Boolean Data Type 55 Loops-More Like an Airplane Than a Brick 58 Programming Example- Calculating Bank Interest 64 Quick to the Draw 68 Chapter Summary 77 4. Functions and More on Data Types 79 Introduction 79 The Char Type 79 The ORD and CHR Functions 80 The SUCC and PRED Functions 83 Other Built-in Functions 83 More on Reals and Integers 84 The Arithmetic Functions 90 The Trigonometric Functions 92 The Logarithmic Functions 92 Console Functions 93 Toolbox Functions 94 User-Defined Data Types 96 The Case Statement 98 Comparing Enumerated Values 100 Subranges 100 User-Defined Functions 101 Drawing Ovals 103 Programming Example-Kepler's Delight 105 -

Reading notes: Source is a table of contents excerpt; headline inferred from running header and product names limited to the title as printed.

Printed product names
TuRBo PASCAL FOR THE MAC
Languages
English
PDF page 6

Chapter Summary 107 5. Procedures 109 Introduction 109 Sequence of Execution 110 Using Procedures 111 Programming Example-Mortgage Calculator 123 6. Arrays and Strings 129 Introduction 129 Arrays 129 Programming Example-The TicTacToe Program 143 Strings 148 The String Functions and Procedures 151 7. More on Structures 155 Introduction 155 The Repeat Loop 155 The Bubble Sort 158 Records 159 Time and Date Operations 169 Sets 170 Recursion 175 8. A Formal Look at Graphics 181 Introduction 181 Points 181 Drawing Lines 182 The Pen 190 The Cursor 194 Building a SketchPad 194 Displaying Text 196 Calculations with Rectangles 199 SketchPad Revisited 199 Fun Time with QuickDraw-The PaddleBall Program 203 Chapter Summary 210 CONTENTS V

Reading notes: Source is a table of contents with chapter and section titles; no advertised products, prices, or dates are present.

Languages
English
PDF page 7

vi TuRBO PASCAL FOR THE MAC 9. Files 211 Introduction 211 Files 211 Text Files 220 File Programming Techniques 224 A File Processing Application-The Checking and Savings Program 227 Chapter Summary 249 10. Variant Records, Pointers, and Handles 251 Introduction 251 Variant Records 251 Pointers 256 The Memory Manager 263 Why Bother, Who Cares? 272 11. Events and Event Handling 273 Introduction 273 Events 274 The Toolbox Managers 274 Event Types 277 Pull-Down Menus 291 Swapping Menu Bars 300 Displaying the Apple Menu 303 The SystemTask Procedure 306 Miscellaneous Menu Routines 308 12. A Complete Macintosh Application-The TurboDraw Program 313 Introduction 313 Drawing Programs 314 TurboDraw 314 Connecting the Nodes with Edges 323 Printing Pictures 325 Loading and Saving the Data Structures 330 FileNames 332 -

Reading notes: Source is a table of contents rather than advertising copy; headline is not clearly identifiable.

Languages
English
PDF page 8

Appendix A. Turbo Pascal Reserved Words

Appendix A. Turbo Pascal Reserved Words 349 Appendix B. Turbo Pascal Menu Summary 350 Appendix C. Compiler Error Messages 358 Appendix D. IOResult Codes 361 CONTENTS vii Appendix E. Documenting a Program 363 Appendix F. Differences Between Turbo Pascal and Macintosh Pascal 370 Appendix G. Turbo Pascal Syntax Diagrams 373 Appendix H. Units 388 Appendix I. Macintosh Character Set 391 Bibliography 392 Index 394

Reading notes: Headline taken from first line of table of contents; primary heading unclear

Printed product names
Turbo Pascal · Macintosh Pascal
Languages
English
PDF page 9

Other Brady Books by Paul Goodman and Alan Zeldin The MacPascal Book, 1985 Other Brady Books by Paul Goodman The Commodore 64 Guide to Data Files and Advanced Basic, 1984 TRADEMARK LIST Macintosh is a trademark licensed to Apple Computer Inc. Mac is a trademark of Apple Computer Inc. LaserWriter is a trademark of Apple Computer Inc. ImageWriter is a trademark of Apple Computer Inc. Turbo Pascal is a trademark of Borland International Macintosh Pascal is a trademark of Apple Computer Inc. IBM PC is a trademark of International Business Machines Corpo- ration MacWrite is a trademark of Apple Computer Inc. MacPaint is a trademark of Apple Computer Inc. MacDraw is a trademark of Apple Computer Inc. Limits of Liability and Disclaimer of Warranty The authors and publisher of this book have used their best efforts in preparing this book and the programs contained in it. These efforts include development, research, and testing of the theories and pro- grams to determine their effectiveness. The authors and publisher make no warranty of any kind, expressed or implied, with regard to these programs or the documentation contained in this book. The au- thors and publisher shall not be liable in any event for incidental or consequential damages in connection with, or arising out of, the fur- nishing, performance, or use of these programs.

Reading notes: Line-break hyphenation in 'Corpo-ration' and 'fur-nishing' may split words across lines Extraneous spacing around some trademark names may reflect original typesetting

Printed product names
The MacPascal Book · The Commodore 64 Guide to Data Files and Advanced Basic · Macintosh · Mac · LaserWriter · ImageWriter · Turbo Pascal · Macintosh Pascal · IBM PC · MacWrite · MacPaint · MacDraw
Printed dates
1985 · 1984
Languages
English
PDF page 10

PREFACE On a cold day in the winter of 1642, in the northwest corner of France, a young man put the finishing touches on a strange device built from gears, pegs, and dials. On a snowy day in 1971, in Zurich, Switzerland, a university prof es- sor put the finishing touches on a paper for publication. On a sunny day in 1976, in a garage in northern California, two young men wearing jeans put the finishing touches on a computer no one could have predicted would cause a revolution. History has ways of connecting events that take place hundreds of years and thousands of miles apart. None of these men could have realized the importance of their work in the future, nor completely understood their connection to the past. On a hot day in 1986, in Lexington, Utah, a team of computer scien- tists at Borland International linked the works of Blaise Pascal, the seventeenth-century mathematician, natural philosopher, and inven- tor of the first adding machine, to Nikolas Wirth, designer of the Pas- cal computer language, and to Steven Jobs and Steven Wozniak, founders of Apple Computer, and completed an extraordinary com- puter language, Turbo Pascal for the Macintosh. That is the legacy of this book. Turbo Pascal for the Mac is intended for both the novice who wants to learn how to program and the expe- rienced Pascal programmer who wants to use Turbo Pascal. A high- light of the book is its discussion of how to use QuickDraw graphics to produce animation and interesting graphics effects. Graphics are inte- grated into each chapter to demonstrate the topic and to provide some entertainment. A separate graphics chapter includes a video game program and ideas for others. As a full implementation of Pascal, Turbo Pascal allows a program- mer to express problems in a natural form that is similar to how people ix

Reading notes: Hyphenated line breaks in 'pro-fessor' and 'es-sor' require reading-order confirmation Spacing irregularities such as 'prof es-sor' may reflect OCR artifacts

Printed product names
Turbo Pascal for the Macintosh · Turbo Pascal · Pascal
Printed dates
1642 · 1971 · 1976 · 1986
Languages
English
PDF page 11

TURBO PASCAL FOR THE MAC

X TURBO PASCAL FOR THE MAC think. As Macintosh software, Turbo Pascal takes full advantage of the unique features of the Macintosh, making it easy to learn, to use, and to debug the occasional programming mistakes that inevitably occur. This book contains all that you will need to become a proficient Pascal programmer. --

Languages
English