Introduction to Macintosh BASIC
From the originals
13 scansMachine-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™ BASIC Scot Kamins
A green book cover with orange and red accents shows a surreal painting of a headless man in a dark suit and red tie beneath a beige Macintosh computer with keyboard and mouse floating among clouds.
Reading notes: Small wordmarks such as 'HAYDEN Macintosh Library' and 'Apple Press' are stylized and read with some uncertainty about exact letterforms.
- Languages
- English
PDF page 1
Introduction to Macintosh BASIC
HAYDEN Macintosh Library Apple Press Introduction to Macintosh BASIC Scot Kamins
A surreal book cover with a green background showing a beige Macintosh computer with keyboard and mouse floating above a headless figure in a dark suit and red tie against a cloudy sky inside an orange-bordered frame.
Reading notes: Publisher and series names appear in stylized script and may be imperfectly rendered; 'Macintosh Library' is set in red script and the 'HAYDEN' label is in spaced capitals. Trademark symbols after 'Macintosh' and 'Apple Press' are small and treated as part of the printed text.
- Printed product names
- Macintosh BASIC
- Languages
- English
PDF page 2
The image is a entirely blank white page with no visible artwork, layout, or text.
Reading notes: No visible text or graphics appear anywhere on the page, so the transcript is empty.
PDF page 3
Introduction to Macintosh™ BASIC Scot Kamins Ill HAYDEN BOOK COMPANY a division of Hayden Publishing Company, Inc. Hasbrouck Heights, New Jersey and Berkeley, California
Reading notes: Headline spacing and trademark symbol rendering uncertain
- Languages
- English
PDF page 4
Apple believes that good books are important to successful computing. The Apple Press imprint is your assurance that this book has been published with the support and en- couragement of Apple Computer, Inc., and is the type of book we would be proud to publish ourselves. Acquisitions Editor: Michael McGrath Production: The Compage Company, San Francisco Cover design: Jim Bernard Cover photo: Lou Odor Composition: Terry Robinson & Co., San Francisco Printed and bound by: Command Web Offset, Inc. Library of Congress Cataloging in Publication Data Kamins, Scot. Introduction to Macintosh BASIC. Includes index. 1. Macintosh (ComputerJ-Programming. 2. Basic (Computer program language) I. Title. II. Title: Introduction to Macintosh BASIC QA76.8.M3K36 1984 001.64'2 84-15837 ISBN 0-8104-6550-7 Copyright© 1984 by Hayden Book Company. 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 stor- age and retrieval system, without permission in writing from the Publisher. Macintosh is a trademark of Macintosh Laboratory, Inc., licensed to Apple Computer; Inc., neither of which is affiliated with Hayden Book Company. MacWite, MacPaint, and Apple Press are trademarks of Apple Computer; Inc. Printed in the United States of America 1 2 3 4 5 6 7 8 9 84 85 86 87 88 89 90 91 92 Printing Year
Reading notes: Library of Congress cataloging line includes OCR-like artifacts such as 'ComputerJ-Programming' and '001.64'2', which may be misread characters.
- Printed product names
- Macintosh BASIC · Macintosh · MacWite · MacPaint · Apple Press
- Printed dates
- 1984 · 84-15837
- Languages
- English
PDF page 5
This book is dedicated to the joy of discovery and to all who support it, and especially to those who embody it, and most especially to John Dillon Riley Lumberjack Extraordinaire who is, among those who support those who support the joy of discovery, the supportingest.
- Languages
- English
PDF page 6
Preface This is a nonacademic tutorial about Macintosh BASIC . It is primarily for people who have never programmed before. If that's you, and if you enjoy learning by doing rather than by being talked at, this is the book for you. It is based almost totally on your experiencing BASIC rather than being "taught" about it (as if any book could really teach a process). The book provides the framework, the hints, the suggestions, the experiences; you do the programming. This tutorial assumes that you 're sitting at your Macintosh with the book in front of you, ready to use the mouse and to type things on your computer's keyboard. It is not meant to be read on the bus going to or coming from work or school. It is a book to use, not to study. This tutorial also assumes: 1. You have access to an Apple Macintosh computer and the Apple Macintosh BASIC language disk; 2. You have read the Macintosh Owner's Guide and know how to turn the computer on; 3. You want to learn how to program MacBASIC. That's all you need. The book provides everything else. Except the pizza. vii
- Printed product names
- Macintosh BASIC · Apple Macintosh · Macintosh Owner's Guide · MacBASIC
- Languages
- English
PDF page 7
viii Preface An Implied Contract Your using this book implies a contract between us. On the one hand, I agree to provide you with the best hands-on tutorial I know how to write: to provide good learning experiences, make timely sug- gestions, give you information that is true and relevant, stimulate you to teach yourself good programming practices, and keep you enter- tained so that your learning is fun. You, on the other hand, agree to follow the suggestions I make: to use this tutorial at the computer, to type in the programs, and to experiment as much and as often as you can with the Apple Macintosh BASIC language. If I live up to my part of the bargain (and I have), and you live up to yours (I trust you), by the time you finish this book you'll know how to write a fairly complex BASIC program with (if you want) some fairly flashy graphics and even some animation. More importantly, you 'II have learned sound programming practices that will serve you for as long as you pound a keyboard. You won't learn all of the commands, statements, functions, tools, and other goodies that Apple's Macintosh BASIC provides; no single tutorial can cover them all effectively. But you'll learn a great deal, you'll learn it well, and you'll have a good time into the bargain. SCOT KAMINS San Francisco, California
Reading notes: Spacing and hyphenation in the OCR text are irregular, e.g. 'I 'II' and 'sound programming' may be misread.
- Printed product names
- Apple Macintosh BASIC
- Languages
- English
PDF page 8
Acknowledgments 'Ihere are a number of people who either directly through their sup- port or indirectly through their example contributed to this work. First among these is Donn Denman who created Macintosh BASIC and who for the last two years has been my incredibly patient teacher. Chris Espinosa, manager of Macintosh User Education, encour- aged me to write this book in the first place. Steve Smith, codeveloper of the Communitree Electronic Con- ferencing System, created the graphics for this book, corrected the manuscript, and found more program bugs than I care to admit. Mike McGrath, West Coast Acquisitions editor for Hayden Books, gave constant reinforcement and provided excellent lunches. Ellen Romano, astoundingly creative graphic artist at Apple Computer, played "naive user" and wrote a review of the manuscript that gave wonderlul support just when I needed it. Dean Gengle, author of The Netweaver's Sourcebook, said "Do the work" when I complained that I was stuck or bored or Just Couldn't Do It Anymore. This is the work. ix
Reading notes: Some characters appear as OCR-style errors (e.g., 'Ihere', 'wonderlul', 'Just Couldn't')
- Printed product names
- Macintosh BASIC · Macintosh User Education · The Netweaver's Sourcebook
- Languages
- English
PDF page 9
Contents Session 1 Getting Started 1 How This Book Is Organized 1 How to Use This Book 3 What's in What Session 3 Conventions Used in This Book 6 Now That You've Read This Far ... 6 Your First Programming Tip 9 Session 2 The Programming Environment 11 How a Program Works 11 Languages 12 Syntax 12 The MacBASIC Environment 13 Entering Your First MacBASIC Program 14 What "Run" Does 17 A Note on Errors 18 xi
- Languages
- English
PDF page 10
Session 3 Session 4 Xii Contents Editing Select, Copy, and Paste Cut Editing Letters, Words, and Phrases Clear and the Backspace Key: Removing Without Replacing Undo An Editing Shortcut Play Time Summary Introduction to Variables 18 21 21 22 25 26 27 28 28 31 Computer Arithmetic 32 Names of the Parts 33 Meaningful Variable Names 35 For Technotypes Only: How Variables Work 36 Making the Program More Flexible 37 Data vs. Information 38 Punctuated PRINT 38 INPUT: Getting Information from the Outside World 41 INPUT Prompt Messages 43 Program Comments(!) 46 Saving the Program 46 The Different Save Commands 47 The Dialog Box 48 All the Restrictions for Program Names 49 Summary 50 Loops Some Loop Definitions The DO"'-LOOP Construct A Loop Counter EXIT and IF . .. THEN : A Loop's Escape Hatch IF ... THEN: A Powerful Construct The Relational Operators IF ... THEN with Other Keywords IF . .. THEN ... ELSE About the Scroll Bar Summary 53 53 54 57 58 61 61 62 65 66 71
Reading notes: Source appears to be a table of contents from a programming textbook rather than an advertisement, so no headline, products, prices or dates were identified.
- Languages
- English
PDF page 11
xiii Contents Session 5 Controlled Loops 73 FOR"'NEXT: More Control, Greater Complexity 74 How It Works 76 An Implied STEP 77 Using Variables in the FOR Line 78 EXIT in a FOR"'NEXT Loop 81 Counter as Totaler 81 Nesting: Loops Within Loops 82 First Taste of String Variables 86 Setting Up String Variables 86 Section on Variable Redundancy Section 87 INPUT with Strings 87 How Not to Assign a String Value 88 Identity Crisis: Numbers in Quotes 88 Relational Operators with Strings 88 A String Variable Idiosyncrasy: The Null String 90 Experiment Time! 91 The Challenge: Program a BASIC Cash Register 92 Planning Phases 92 The CLEARWINDOW Keyword 93 The Challenge 93 Don't Let the Bugs Get You Down 94 Summary 95 Session 6 Graphics and the Mouse 99 The Graphics Area 99 The PLOT Statement 100 Drawing Lines 102 Combining PLOT Statements 104 Quick Window Cleaning 104 From Points to Rectangles 106 Shapes Need Two Keywords 107 Using Variables with Graphic Objects 107 Slowing Things Down 110
Reading notes: Contents listing lacks a primary heading; headline set to null Some hyphenated and spaced characters (e.g. "FOR"'NEXT") may reflect OCR artifacts
- Languages
- English