# Using Macintosh BASIC — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1)

## Transcribed source material

Machine transcriptions and image descriptions; uncertain copy may be marked [illegible]. Verify against the linked originals. Historical rights remain with the original owners.

These are transcribed excerpts, not the full publications. Open the originals for remaining pages.

### Image 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-0951929d8f3f1d36d065380233b0c026a948054a976af058e8f2a54a7d8af298)

Transcribed text:

Osborne McGraw-Hill using Richard Norling
Macintosh™ BASIC

Image description: A book cover with a grey background, a blue brushstroke bar beneath the red title, and rows of colorful painted apples with stems and shadows in shifting hues from blue-green to red to green to purple.

Reading notes: The author name and publisher are small and set on the top line, so their exact layout is approximate; the 'using' is a stylized script word.

Languages: English

[Original Image 1](https://www.vintageapple.net/files/c3c0663ebb15c10175d0061bbdedac93638779531d344cb830320943de391524/a21c5790c1a1874de4503aa4.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-7adb5c31941fd23f607d905f4103784873a8e3c8a65982863347af6805021f36)

Transcribed text:

Osborne McGraw-Hill using Richard Norling

Macintosh™ BASIC

Image description: A book cover with a grid of colorful crayon-style apples in rows, each casting a shadow, with a blue brushstroke under the red title 'Macintosh BASIC' and a teal script 'using' above.

Reading notes: The publisher name 'Osborne McGraw-Hill' and author name are small and set in a different typeface; the script word 'using' is stylized and read as 'using'.

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-045db659807417e2b1f7572b393f0cd3d3b01cd26f7524b94560279dfc28a6d0)

Transcribed text:

B177-XXT
SOFTWARE SUPERMARKET
$17 95

Image description: A small rectangular price tag label in the upper left corner of an otherwise blank cream page, showing a black handwritten-style code, a red 'SOFTWARE SUPERMARKET' logo, and a black price.

Reading notes: Price appears as '$17 95' with a space, possibly a decimal point rendered as a space; not certain whether it is $17.95. The label's code 'B177-XXT' and the store name are small and could be misread; the stray mark at the lower left of the label is not transcribed.

Printed product names: SOFTWARE SUPERMARKET

Printed prices: $17 95

Languages: English

[Original PDF page 2](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=2)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-b7c219623fd0dc3f1aa782c88fdbf4eef0a5608f2f0c1c4473f6dea92a83e89a)

USING MACINTOSH BASIC

Transcribed text:

Published by
Osborne McGraw-Hill
2600   Tenth Street
Berkeley, California   94710
For information on translations and book distributors outside
of the   U.S.A.,   please write to Osborne McGraw-Hill at the
above address.
The manuscript for this book was written using   MacWrite™   running
on 512K Macintosh and a Lisa 2/5 with   MacWorks™.
Macintosh, MacWrite, MacPaint, Lisa, The Finder, and MacWorks
are trademarks of Apple Computer, Inc.
Apple is a registered trademark of Apple Computer, Inc.
Microsoft is a registered trademark of Microsoft   Corp.
USING   MACINTOSH™   BASIC
Copyright   ©   1985 by McGraw-Hill, Inc. All rights reserved. Printed in
the United States of America. Except as permitted under the Copyright
Act of 1976, no part of this publication may be reproduced or distributed
in any form or by any means, or stored in a data base or retrieval system,
without the prior written permission of the publisher, with the   excep-
tion that the program listings may be entered, stored, and executed in a
computer system, but they may not be reproduced for publication.
11234567890   DODO   9989765
ISBN   0-07-88157-0
Karen Hanson, Acquisitions Editor
Dave   Ushijima,   Technical Editor
Ted Gartner, Copy Editor
Nancy Leahong, Text Design
Donna Behrens, Composition
Yashi   Okita,   Cover Design
Library of Congress Cataloging in Publication Data
Norling, Richard, 1943-
Using   Macintosh   BASIC.
Includes index.
I.   Macintosh (Computer)- Programming.   2. Basic
(Computer program language)   I.   Title.
QA76.8.M3N67 1985   001.64'2   85-2934
ISBN 0-07-88157-0

Reading notes: Library of Congress catalog line ('001.64'2') includes OCR-like punctuation that may be imperfect Copyright year and ISBN digits in the colophon could be misread in reproduction

Printed product names: MacWrite · 512K Macintosh · Lisa 2/5 · MacWorks · MacPaint · Lisa · The Finder · Macintosh · Microsoft

Printed dates: 1985 · 1976 · 1943

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-1bc37283532560284337a9262ab8374689ce53f8ab786dc3292b059350d3bdbf)

Transcribed text:

Contents
Introduction   Vl
Part   One   Fundamentals of Macintosh   BASIC
Chapter   I   Getting Started   1
Chapter   2   Creating Programs   11
Chapter   3   Statements and   Operators   21
Chapter   4   Editing Programs   35
Chapter   5   Making Decisions   53
Chapter   6   Organizing   Your   Program   69
Chapter   7   Using   Functions   81
Chapter   8   Manipulating Strings and Text   95
Part Two   Intermediate Techniques   111
Chapter   9   Variables, Data, and Arrays   113
Chapter   JO   Formatting Program   Output   137
Chapter 11   Defining   Your   Own   Functions   159
Chapter 12   Using   Files   173
Chapter 13   Files, Volumes, and Devices   195
Chapter 14   Using   the Interactive Debugger   223
Chapter 15   Advanced Control Structures   233

Reading notes: OCR-style digit 'JO' in 'Chapter JO' may be a misread of '10' Chapter numbers 'I' and '2' appear as OCR-style variants

Printed product names: Macintosh BASIC

Languages: English

[Original PDF page 5](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-0056f8d9685d3a586e7da8a0a9ab31dc4af7cf5b4ff6b9a76d658983c69af8b1)

Transcribed text:

Part Three   Special   Macintosh Techniques   247
Chapter 16   Graphics and Shapes   249
Chapter 17   Using the Mouse   269
Chapter 18   Making Music   283
Part Four   The Macintosh Toolbox   297
Chapter 19   Using the Macintosh Toolbox   299
Chapter   20   Windows and Menus   313
Chapter 21   Using Controls   331
Chapter 22   QuickDraw Graphics   347
Chapter 23   Using Resources   363
Part Five   Programming   Style   383
Chapter 24   Professional   Polish   385
Appendix A   Macintosh BASIC Commands and
Functions   393
Appendix B   Error Messages and Codes   405
Appendix   C   ASCII Codes and Keyboard Characters   411
Appendix D   Toolbox Routines Accessible From BASIC   417
Appendix E   Solutions to   Practice   Exercises   437
Index   451

Languages: English

[Original PDF page 6](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-cf599b49c5bbab454605adae979320c8f671d62f55027e4bf12aab565e733a70)

Transcribed text:

Acknowledgments
I want to thank all the people who worked on Apple Computer's
team to develop the Macintosh BASIC language, without which
this book would not have been possible.
Three of these people made special contributions. Donn   Den-
man, the chief creator of the language, was informative, patient,
and understanding even when I managed to interrupt his work.
Edward   Spiegel   answered many questions and helped me get all
the technical details right as new features were added to the lan-
guage.   Marianne Hsiung helped me understand several   points.
Their contributions have made this a better book.
RDN

Reading notes: Signature initials 'RDN' at end are not expanded in the source text

Printed product names: Macintosh BASIC

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-540aecc90c9a5b7de504f8ec728c9c3ac5adef8307172a92878979aca600e0da)

Transcribed text:

Introduction
This book is a comprehensive guide to Apple Computer's Macin-
tosh   BASIC language.   It is   a   complete reference   to   Macintosh
BASIC that progresses from a simple one-line program to compli-
cated programs using advanced computer concepts.
BASIC   is   the   most   widely   used   programming   language on
microcomputers because it is the easiest language to learn. Macin-
tosh BASIC is even easier to learn and use than the versions of
BASIC   found on most other machines.   It   is an interactive language
that displays corrective messages as soon as you enter a line that
contains an error. The messages are written in normal English
instead of computer jargon and are usually clear enough to enable
you to correct the error without referring to written documentation.
Macintosh BASIC is incrementally compiled, a technique that
makes it faster than most other versions of   BASIC.   Its program-
ming environment includes a full-program editor that allows you
to use all of the normal Macintosh editing techniques.The built-in
interactive debugger is an effective learning and programming tool
that is fun to use.
A concerted effort has been made to use normal English in this
book. Many books about computers use technical terms and com-
puter jargon so frequently that it is difficult for the non-expert to
understand the concepts being discussed. This book discusses con-
cepts in English, using technical terms and jargon only where they
add to understanding.
vi

Printed product names: Macintosh BASIC

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-f9264a47e9b0fa875b8944af5be58a566dab275f7daa3400402ef5fb2b24ab28)

HOW TO USE THIS BOOK

Transcribed text:

HOW   TO   USE   THIS   BOOK
You   do not have to finish reading this book before you write a
computer program in Macintosh   BASIC.   Computer programming
is best learned by doing. The most important part of learning to
program computers is the experience you gain by actually writing
programs.   So   start using commands in your programs as soon as
you read about them.   You   will learn much more quickly if you do.
This book was organized to present the concepts of computer
programming and the Macintosh   BASIC   language in a logical
manner,   laying   the   foundation   carefully   with   simple   concepts
before building up to advanced concepts.   If   you want to proceed
carefully and cautiously, you should start with Chapter 1 and work
through the book.
The explanations, guidance, help, suggestions, reference infor-
mation, and practice exercises in the book are designed both to
make your learning experience go smoothly and to serve as refer-
ence materials once you have started to write programs.   If   you are
particularly curious about a particular command or subject, feel
free to jump ahead and read about it. Just keep in mind that a
complete   understanding   of   it   may   depend   on   something   you
skipped earlier in the book.
HOW   THIS   BOOK   IS   ORGANIZED
This book is organized into five parts. Part   One,   Fundamentals of
Macintosh   BASIC,   contains eight chapters that explain the fun-
damentals of Macintosh   BASIC.   The topics include a description
of Macintosh   BASIC's   windows and menus, operators, program
editing techniques, conditional statements, simple control struc-
tures, functions, and string manipulations. By the time you finish
these   chapters,   you   will   be   able   to   write   a   variety   of   BASIC
programs.
The   seven   chapters   in   Part   Two,   Intermediate   Techniques,
introduce subjects that will help you write more complicated pro-
grams.   These   subjects   include defining data   arrays,   formatting
output, defining your own functions,   reading and writing data
files on disk, using Macintosh   BASIC's   interactive debugger, and
passing parameters to subroutines.
Part Three,   Special   Macintosh Techniques, describes the Macin-
vii

Reading notes: Source text ends mid-word at 'Macin-' on page vii, so the Part Three description is truncated.

Printed product names: Macintosh BASIC

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-3ec862f2cc4f4518cd45b5cb75e84ef2b9afb25e4e9e3d7ba7c51a70dc019204)

Transcribed text:

tosh   BASIC   commands that let you handle graphics, the mouse,
and sound. While many commands are identical or similar from
one version of   BASIC   to another, the commands described in these
chapters are unique to Macintosh   BASIC   because they were specif-
ically designed for use with Macintosh hardware.
Part Four, The Macintosh Toolbox, describes how to use the
routines   in   the   Macintosh   toolbox.   The   features   of   Macintosh
BASIC   described in Part Four are not described in the Macintosh
BASIC   reference manual published by Apple Computer.   These
undocumented features of Macintosh   BASIC   allow you to use the
Macintosh toolbox routines to handle windows, menus, controls,
graphics objects, resources, and assembly language programs.
The last part, Programming Style, briefly discusses some of the
things involved in polishing your program to professional quality.
A   NOTE   TO   EXPERIENCED   PROGRAMMERS
If   you are an experienced programmer, you may be surprised to see
what has happened to   BASIC.   Macintosh   BASIC   is a structured
programming language. It gives you the ability to use either labels
or line numbers, and provides new control structures like   CASE
and   DO/LOOP,   re-entrant subroutines with parameter passing,
and separate programs with parameter passing and local variables.
This book teaches structured programming techniques.   Stan-
dard   BASIC   GOTO   statements are used in   Chapter   5   to introduce
the concept of flow   of control, but appear nowhere else in   the
book.   POP   is listed in Appendix A for completeness, but is omit-
ted from the text.
DISK   OF   PROGRAMS
If   you prefer not to type long programs, the programs labeled as
Figures in this book are available on a single Macintosh disk. The
programs are intended for educational purposes only.   For more
information about ordering one of these disks, write to:
Language Systems   Corp.
1217 E Street, S.E.
Washington,   DC   20003
viii

Reading notes: Opening text is truncated at the start of the excerpt, so the preceding heading or context is unclear. Some copy is in all-caps or spaced letters, which may affect exact spelling of product names.

Printed product names: Macintosh BASIC · Macintosh

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=10)

### PDF page 11 · PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-cfb362cce248d8785d6d3cf72e15ce9dd3e039b0dadca44334bbfee0bc57566b)

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

[Original PDF page 11](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=11) · [Original PDF page 3](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=3)

### PDF page 12

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-macintosh-basic-1985-a33aec/1#scan-692303539e272244a49d78cc7ffff05c07a07121d7b7353a1a656bb643e38ff7)

Transcribed text:

---cluif-W!---
Getting Started
You have a disk that contains Macintosh   BASIC   and are ready to
start programming. But where do you begin? In this chapter you
will start by reviewing some elementary concepts. You will learn
what a computer program does and will get an overview of how
Macintosh   BASIC   translates programs that you write into a form
that the machine can understand. Finally, a quick look at Mac-
intosh   BASIC's programming environment,   including windows
and menus, will get you started.
PROGRAMS
A computer is a collection of electronic parts based on simple
yes/no or on/off logic. Included in the computer are a central pro-
cessing   unit   (CPU)   and   random-access   memory,   which   holds
instructions and data while the computer is operating.
1

Reading notes: Leading garbled characters '---cluif-W!---' at start of source may be damaged text

Languages: English

[Original PDF page 12](https://www.vintageapple.net/files/a90c28fc7068c96f351421139f6c0f717e0e7775fe2f321481af23430976cf72/Macintosh_Basic_1985.pdf#page=12)
