← The Macintosh BASIC Handbook

The Macintosh BASIC Handbook

From the originals

34 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

SYBEX COMPUTER BOOKS The Macintosh™ BASIC H A N D B O O K Thomas Blackadar Jonathan Kamin

A book cover with a black background, yellow title text, and a collage-style illustration of a red plaid-patterned apple with a green leaf and stem, with yellow BASIC-style letter shapes and a white plate-like base at the bottom.

Reading notes: The stylized 'BASIC' letters in the illustration are not independently transcribed; only the printed title text is quoted. The small 'SYBEX COMPUTER BOOKS' logo text is partly cropped at the left edge and was read as 'SYBEX COMPUTER BOOKS'.

Printed product names
BASIC
Languages
English
PDF page 1

SYBEX COMPUTER BOOKS The Macintosh™ BASIC H A N D B O O K Thomas Blackadar Jonathan Kamin

A book cover with a black background, yellow title text, and a collage-style illustration of a red-and-green plaid apple with a green leaf and yellow letter-like cutouts on a white plate.

Reading notes: The letters in the apple collage are cut-out shapes and may be partly decorative rather than readable text; they were not transcribed. The title is set in the 'HANDBOOK' spaced-letter layout and was transcribed with spacing preserved as shown.

Languages
English
PDF page 2

The image is a fully blank white page with no visible artwork, layout elements, or text.

Reading notes: No visible text appears anywhere on the page, so all printed fields are empty.

PDF page 3

THE MACINTOSH™ BASIC HANDBOOK THOMASBLACKADAR JONATHAN KAMIN D ~EX ® e BERKELEY • PARIS • DUSSELDORF • LONDON

Reading notes: Author names and publisher imprint lines are partially garbled ('D', '~EX ®', 'e' fragments) and may be OCR artifacts.

Languages
English
PDF page 4

Cover design by Peter Bartczak Book design by Lisa Amon Apple, Apple II, Applesoft BASIC, Lisa, MacPaint, MacWrite, and ProDOS are trademarks of Apple Computer, Inc. Macintosh is a trademark licensed to Apple Computer, Inc. Asteroids is a trademark of Atari, Inc. IBM is a trademark of International Business Machines, Inc. Microsoft and Multiplan are trademarks of Microsoft Corp. The toolbox interface is not an official feature of Macintosh BASIC. The inclusion of this information does not imply an endorsement of this feature by Apple Computer, Inc. Misuse of toolbox calls can lead to serious system errors. SYBEX is not affiliated with any manufacturer. Every effort has been made to supply complete and accurate information. However, SYBEX assumes no responsibility for its use, nor for any infringements of patents or other rights of third parties which would result. Copyright©1984 SYBEX Inc., 2344 Sixth Street, Berkel~ CA 94710. World rights reserved. No part of this publication may be stored in a retrieval system, transmitted, or reproduced in any wa)I including but not limited to photocoP)I photograph, magnetic or other record, without the prior agreement and written permission of the publisher. Library of Congress Card Number: 84-72624 ISBN 0-89588-257-4 Printed by Haddon Craftsmen Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1

Reading notes: Some words are split by spacing and characters such as 'wa)I' and 'photocoP)I' appear to be damaged OCR of 'way' and 'copy'.

Printed product names
Apple II · Applesoft BASIC · Lisa · MacPaint · MacWrite · ProDOS · Macintosh · Asteroids · IBM · Microsoft · Multiplan
Printed dates
1984
Languages
English
PDF page 5

To our friends in the editorial and production depart- ments, who have given so much ·of themselves for such little books as these. T.A.B. and J .K.

Reading notes: Source text is a dedication with no explicit headline, products, prices, or dates; the initials 'T.A.B.' and 'J .K.' contain an irregular space in 'J .K.'

Languages
English
PDF page 6

Acknowledgments This book has been a group effort from start to finish, and it would be hard to thank all those who deserve thanks. The "Macintosh BASIC Tham" at SYBEX deserves more credit than they will ever possibly get. Rudolph Langer was there at the beginning to direct the initial ideas, and he stayed with it until the very end. David Kolodney gave his time and care to make this a good book, in spite of the pressures. Barbara Gordon and Karl Ray lent their considerable managerial talents. Bonnie Gruen and Jeremy Elliott kept track of the myriad technical and logistical details. Valerie Robbins and Sarah Seaver took care of the entire word- processing operation. Bret Rohmer and his production staff deser\re special thanks for their quality work and attention to detail: Donna Scanlon and Janis Lund, typesetting; Lisa Amon and Nina Hoecker, graphics and design; Dawn Amsberry and Brenda Walker, proofreading; and Elimbeth Thomas, coordination. We appreciate all of you. Outside of SYBEX, a number of other people made important contribu- tions. Doug Hergert graciously allowed us to use programs and text from his Apple II BASIC Handbook (SYBEX). Herbert Diamant and Joan Philips contributed programs and technical insights. And of course, this book would have gotten nowhere without the assistance of Apple Computer, Inc. We would like particularly to thank Kevin Jones and Ed Spiegel for their cooperation in helping us spread the word about their wonderful BASIC language. Also, special thanks to Nancy Kamin, for keeping a significant portion of the universe running while this book was being written.

Reading notes: Possible OCR errors: 'Tham' (likely 'Team'), 'deser\re' (likely 'deserve'), 'Elimbeth' (likely 'Elizabeth')

Printed product names
Macintosh BASIC · Apple II BASIC Handbook · BASIC
Languages
English
PDF page 7

q .___I _T:_ab_l_e_o_f_C_on_t_en_t_s ___.Ip D Acknowledgments D The Entries at a Glance D Reference Guide to Major Programming Concepts D How to Use the Macintosh BASIC Handbook D Introduction: An Overview of Macintosh BASIC D The Macintosh BASIC Commands- Including the Macintosh Toolbox Alphabetical entries, containing: • Syntax • Description • Sample Programs • Applications • Notes 0 Appendix A: ASCII Codes D Appendix B: Error Codes D Appendix C: System Constants D Appendix D: Summary of Toolbox Commands D Appendix E: Index to Application Programs

Reading notes: Table of contents layout and reading order are ambiguous due to fragmented line breaks.

Printed product names
Macintosh BASIC · Macintosh BASIC Handbook · Macintosh Toolbox
Languages
English
PDF page 8

The Entries at a Glance ABS DEVSTATUS ErasePoly GOTO AND DiffRgn EraseRgn GPRINT ANNUITY DIM ERR GTEXTFACE APPEND DisposeRgn EXCEPTION GTEXTMODE ASC DIV EXIT GTEXTNORMAL ASK DO EXP HALT ATEOF DOCUMENT EXP2 HidePen ATN DOWNSHIFT$ (See EXP) HPOS BEGIN EJECT EXPMl HPOS# BINY ELSE (See EXP) IF BTNWAIT EmptyRect FillArc IGNORE WHEN CALL EmptyRgn (See Fill) INFINITY CASE (See EmptyRect) Fill Oval INKEY$ CHR$ END (See Fill) INPUT CLASSCOMP END FUNCTION Fill Poly INPUT# CLASSDOUBLE (See END) (See Fill) lnsetRect (See CLASSCOMP) END IF FillRect lnsetRgn CLASSEXTENDED (See END) (See Fill) (See lnsetRect) (See CLASSCOMP) END MAIN FillRgn INT CLASSSINGLE (See END) (See Fill) INVERT (See CLASSCOMP) END PROGRAM FillRoundRect lnvertArc CLEARWINDOW (See END) (See Fill) lnvertPoly CLOSE# END SELECT FONT lnvertRgn ClosePoly (See END) FONTSIZE KBD CloseRgn END SUB FOR Kill Poly (See ClosePoly) (See END) FORMAT$ LEFT$ COLLATE END WHEN FRAME LEN COMPOUND (See END) FrameArc LET(=) COPYSIGN ENVIRONMENT FramePoly LINE INPUT cos EOF# FrameRgn Line CREATE# EOF- FREE (See LineTo) CURPOS# EOR- FUNCTION lineTo DATA EqualRect GETFILEINFO LOCATION DATE$ EqualRgn GETFILENAME$ LOCK DEF (See EqualRect) GElVOLINFO LOG DELETE ERASE GE1VOLNAME$ LOG2 DEVCONTROL EraseArc GOSUB (See LOG)

Reading notes: Source appears to be an index of programming language keywords rather than advertising copy; no advertised products, prices or dates are present. Several entries are split across lines or contain OCR-like character errors (e.g., 'lnsetRect', 'GElVOLINFO', 'EXPMl').

Languages
English
PDF page 9

LOGB OPEN# RANDOMX ShowPen (See LOG) Open Poly READ SIGNNUM LOGPl OpenRgn READ# SIN (See LOG) OPTION RECORD SOUND LOOP OR RECSIZE SOUNDOVER- Map Poly OUTIN RECT SQR (See MapPt) OUTPUT RectlnRgn STANDARD MapPt OVAL RectRgn STOP MapRect PAINT RELATION STOPSOUND (See MapPt) PaintArc REM (I) STR$ MapRgn PaintPoly REMAINDER STREAM (See MapPt) PaintRgn RENAME StuffHex MID$ PAmRN RESTORE SUB MISSING- PEN RETURN TAB MOD (See PENPOS) REWRITE# TABWIDTH MOUSEB- PENMODE RIGHT$ TAN MOUSEH PEN NORMAL RINT TEXT MOUSEV Pen Pat RND THERE- (See MOUSEH) PENPOS ROUND TICKCOUNT Move PEN SIZE ROUNDRECT TIME$ (See MoveTo) PERFORM SAME TONES MoveTo Pl SCALB TOOL NAN PICSIZE SCALE (See TOOLBOX) NATIVE PLOT SectRect TOOLBOX NewRgn POP SectRgn TRUNC NEXT PRECISION (See SectRect) lYP NEXTDOUBLE PRINT SELECT UNDIM NEXTEXTENDED PRINT# SEQUENTIAL UnionRect (See NEXTOOUBLE) PROCENTRY SET UnionRgn NEXTSINGLE PROCEXIT SETFILEINFO (See UnionRect) (See NEXTOOUBLE) (See PROCENTRY) SetPt UNLOCK NOT PROGRAM SetRect UPSHIFT$ Offsetpoly PROMPT SetRectRgn VAL OffsetRect PtlnRect (See SetRect) VPOS (See OffsetPoly) PtlnRgn SETVOL WHEN OffsetRgn (See PtlnRect) SGN WRITE# (See OffsetPoly) RANDOMIZE SHO.VDIGITS XOrRgn

Reading notes: Source appears to be an index or list of programming-language keywords rather than advertising copy; no advertised products or prices are present. Several entries contain OCR-like damage and hyphenation (e.g., 'MISSING-', 'MOUSEB-', 'OUTIN') and misreadings such as 'OOUBLE' and 'lYP', which are uncertain.

Languages
English
PDF page 10

Reference Guide to Major Programming Concepts Programming Concept Arc shapes (toolbox) Decision blocks and logical expressions File 1/0 commands Line graphics Mouse button and programming techniques Pattern graphics operator (toolbox) Polygon shapes (toolbox) Rectangle array structures (toolbox) Region shapes (toolbox) SELECT/CASE block structures Set-options Subroutines and parameter-passing Toolbox interface, general discussion User-defined functions Entry PaintArc IF OPEN# PLOT MOUSEB- Fill Open Poly SetRect PaintArc SELECT SET CALL TOOLBOX FUNCTION

Languages
English
PDF page 11

How To Use the Macintosh BASIC Handbook

\ How To Use the Macintosh BASIC Handbook This book is structured as an A-to-Z encyclopedia, so that you can use it both for quick reference and for browsing among the commands available in Macintosh BASIC. Along the way, you will also find numerous tips on pro- gramming techniques, more than 150 sample programs, more than 40 practi- cal application programs, and more than 200 screens of output. Every Macintosh BASIC command, function, and operator is described in an entry in this book-in all 189 BASIC keywords in 164 separate entries. In addition, the 54 most useful toolbox words are described in 39 full-scale entries of their own. The toolbox is a group of special routines in the Macin- tosh operating system. Some of these routines can be called from a BASIC program, including many important graphics routines. In addition to these full descriptions, Appendix D: Summary of Tuolbox Commands contains the complete syntax of the more than 300 toolbox words that can be used from Macintosh BASIC. Each entry is organized into the following sections: • Syntax-a summary of the essential structure of the command. All of the important syntax forms of the command are shown here, with a cap- sule description for each one. In stating the syntax for ms, this book strives for clarity and readability, rather than strict conformity with the formal syntax diagrams given in other manuals-diagrams that are so formal and unapproachable that almost no one ever reads them. The only special symbols employed in these syntax forms are vertical ellipses (:), which mark omitted statements, regular ellipses (...), which mark the optional continuation of a series, and square brackets [ ], which sur- round optional parts of the syntax. All syntax forms are stated in exactly the form in which they will be typed into programs. Words printed in italics are conceptual words that should be replaced inside the actual statement by a keyword or a series of expressions. • Description-a detailed discussion of the syntax forms of the command. In commands with multiple syntax forms, each numbered syntax sum- mary from the Syntax section is described under its own numbered head- ing within the Description. In that way, you can go directly to the explanation of the syntax form you want.

Reading notes: Source contains stray backslash before the heading and OCR-style spacing artifacts; 'Tuolbox' appears misspelled in the copy and is preserved as printed.

Printed product names
Macintosh · Macintosh BASIC
Languages
English