← Microsoft Basic Using the SoftCard 1984 II plus IIe

Microsoft Basic Using the SoftCard 1984 II plus IIe

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

JAMES S. COAN author of Basic BASIC Microsoft™ BASIC Using the SoftCard™ for Apple II Plus® and IIe® HAYDEN

A book cover with a grey background covered in a pink dot pattern, bold stacked pink and teal title lettering with black drop shadows, diagonal teal and pink bars, and a small black HAYDEN publisher label at the bottom.

Reading notes: Author line 'author of Basic BASIC' is in small italic-style print and is read as given; 'Basic BASIC' capitalization is as printed. Trademark symbols (™, ®) are included as printed.

Printed product names
Apple II Plus · Basic BASIC
Languages
English
PDF page 1

JAMES S. COAN author of Basic BASIC Microsoft™ BASIC Using the SoftCard™ for Apple II Plus® and IIe® HAYDEN

A book cover with a pink dotted background, large pink and teal block lettering with black drop shadows, diagonal teal and pink bars, and a black Hayden logo box at the bottom.

Reading notes: Title lettering is stylized with drop shadows; the word 'Microsoft' is rendered with a large 'ft' ligature-like overlap that is read as 'Microsoft'. The phrase 'author of Basic BASIC' is set in a smaller script-like font and is read as shown.

Printed product names
Apple II Plus
Languages
English
PDF page 2

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

PDF page 3

Microsoft BASIC Using the SoftCard

Microsoft .. BASIC Using the SoftCard .. James S. Coan [l1 HAYDEN BOOK COMPANY a division of Hayden Publishing Company, Inc. Hasbrouck Heights, New Jersey

Reading notes: Possible damaged characters in the top line 'Microsoft ..' Heading reading order is uncertain between title and author name

Printed product names
SoftCard
Languages
English
PDF page 4

Equipment Reeded • Apple II, Apple II Plus, or an Apple Ile computer with a minimum of 48K of memory • Color television set or monitor • Microsoft SoftCard (at least one disk drive required) To achieve lowercase characters you will need one of the following: · • Apple Ile, an SO-column card, or an external terminal with an appropriate interface card. Production Editor: TERRY DONOVAN Art Director: JIM BERNARD Cover Design: SHARYN BANKS Original Artwork: JOHN McAUSLAND Composition: BI-COMP, INC. Printed and bound by: ARCATA GRAPHICS CO.: FAIRFIELD GRAPHICS DIVISION Apple and Applesof&are registered trademarks of Apple Computer. Inc.; Microsoft is a trademark of Microsoft Corp.; CP/M is a registered trademark of Digital Research. Inc.; none of which is affiliated with Hayden Book Company. 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, includ- ing photocopying and recording, or in any information storage and retrieval system, without permission in writing from the Publisher. Printed in the United States of America 1 2 3 4 5 6 7 8 9PRINT1NG 84 85 86 87 88 89 90 91 92 YEAR

Reading notes: Several words are garbled by OCR, including 'Reeded', 'Ile', 'SO-column', 'Applesof&are', 'Arcata' spacing and 'PRINT1NG'; exact spelling uncertain. Reading order is mixed, with equipment list, credits, trademark notice and copyright text run together. Copyright year 1984 and printing sequence '84 85 86' are printed fine print; the printing number line is partially damaged.

Printed product names
Apple II · Apple II Plus · Microsoft SoftCard · CP/M
Printed dates
1984
Languages
English
PDF page 5

Who knows how many versions of BASIC there are? All are recognizable as emanating from the original BASIC developed at Dartmouth College under John G. Kemeny and Thomas E. Kurtz. Most versions have added new features. BASIC-80, developed by Microsoft, is in use on yast numbers of com· puters today. Therefore, if you learn Microsoft BASIC (also known as MBASIC or MS-BASIC), you will be able to use many computers. In addition, the BASIC we learn will be a good foundation for programming in other versions of BASIC and other computer languages everywhere. Microsoft has developed BASIC in two modes: one is interpretive, and the other is compiled. The interpretive mode of BASIC is highly interac- tive. This interactive nature of BASIC has been a primary reason for its tremendous popularity. We can easily write programs and instantly com- mand the computer to execute them for us. We can even command the computer to execute individual BASIC statements immediately right at the keyboard. Our mistakes and typing errors are often pointed out to us in plain English, rather than in undecipherable code. One of the drawbacks of BASIC is its slow execution speed. The reason for this slow speed is that interpretive languages must analyze and translate each statement into a more primitive form each time it is encountered during program execu· tion. If a statement is executed fifteen thousand times, the interpreter must do the analysis and translation fifteen thousand times. The com- puter derives no benefit from the repetitious nature of the process (see, computers are not as smart as humans!). This interpretation takes more time than the actual program execution. Compiled BASIC overcomes the slow-speed problem. The compiler performs the line-by-line analysis and translation once and creates an entirely new program, which may then be executed without the aid of the BASIC interpreter program. The time required to transform each program statement is eliminated. The icing on the cake is that we have, in Microsoft BASIC, one lan- guage that may be managed in either mode. Thus it is possible to write

Reading notes: Source contains OCR-style hyphenation and spacing artifacts such as 'yast' and 'com·puters' that may not reflect the original print.

Printed product names
BASIC-80 · Microsoft BASIC · MBASIC · MS-BASIC
Languages
English
PDF page 6

and thoroughly test BASIC prognUns interactively and then compile the result for more efficient use of computer resources. This book is about prognUnming in Microsoft BASIC-80 using the SoftCard and CP/M on Apple II, Apple II Plus, and Apple lie computers. BASIC-80 is an enhanced version of the standard Microsoft BASIC. The primary enhancement is the inclusion of low-resolution and high- resolution graphics. Some of the additions are simply to include features for the convenience of Applesoft programmers. Problems included at ap- propriate points in the book make it suitable for the classroom as well as for the individual who wants to learn BASIC. Features of BASIC are generally introduced as they are needed to solve a task. Nearly one hun- dred programs are presented and discussed. The general approach is to begin with small programs to solve real problems and then to build them up into larger programs as required. It is helpful to break any task into small segments. One goal is to write prognUn segments that will fit en- tirely on one screen. We even organize things in such a way that our list of tasks actually become the REMarks that form the prognUn documenta- tion before we begin to write program statements in BASIC. Larger pro- gnimS are developed by first writing a control routine that will manage a collection of subroutines. Then we write the subroutines. Sometimes we have already written some of the subroutines to solve earlier prognim- ming problems. We get started with simple calculations and printed messages in Chapter 1. Chapter 2 introduces numeric and string variables. The loop concept comes up in Chapter 3, with the formal introduction of FOR and NEXT in Chapter 4. We learn about functions and subroutines in Chapter 5. Chapter 6 presents numeric and string arrays. Here an alphabet game rounds out our work with string arrays. With many programming con- cepts and BASIC features in hand, we consider a few interesting applica- tions in Chapter 7. A calendar program, the sieve of Eratosthenes, and different base numbering systems appear here. Chapters 8, 9, and 10 take us from a simple sequential-access file to a workable mailing-list prognim. Low-resolution and high-resolution graphics are the topics of Chapters 11 and 12. Each chapter (except for Chapter 7) is followed by a "Sidelight" sec- tion that presents special features, concepts, and advanced techniques. Topics range from the use of a question mark for PRINT to how to use POKE to change the "Ok" message issued by BASIC after every task. Appendix A compares SoftCard BASIC.with Applesoft. EDIT Mode is discussed in Appendix B with numerous examples. Use of the disk for maintaining a library of prognUns is presented in Appendix C, and an ASCII chart is presented in Appendix D. An index of prognUns in the text appears in Appendix E. Appendix F contains solution prognUns for the even-numbered problems.

Reading notes: Garbled token 'prognUns' and similar variants appear repeatedly, likely OCR damage for 'programs' Text is a book introduction with unclear reading order from column breaks

Printed product names
Microsoft BASIC-80 · SoftCard · CP/M · Apple II · Apple II Plus · Apple lie · Applesoft · BASIC-80 · ASCII
Languages
English
PDF page 7

I wish to thank Alan Boyd of Microsoft Consumer Products for provid- ing material assistance. Mike Violano and Chris Varley of Hayden Book Company, Inc., have made important suggestions and provided valuable counsel in the development of this book. New Hope, Pa. JAMES s. COAN

Reading notes: Hyphenated line break in 'provid-ing' and 'Hayden Book Company' name may need verification

Languages
English
PDF page 8

To the Beader Learning to program a computer can be very exhilarating. The thrill of seeing your first apparently complicated idea implemented in a clear, simple program is wonderful. You will be well advised to look upon the computer as something to be mastered and not as some impersonal mon- ster that is out to do you in. Everything that the computer does is explain· able and predictable. You should take care to evaluate the results that the computer produces; do not blindly accept computer results as faultless. That is not to say that the computer is going to make mistakes. In fact, under normal conditions, the computer will execute your instructions exactly. Mistakes in the results of a program execution are usually caused by errors in the instructions written by the programmer. Resist the temp- tation to blame anything other than your programming for incorrect or unexpected results. No one need fear the computer. This is especially true when it comes to learning. We can work with the computer in total privacy. Errors that the computer reports to us become our secret. Nobody else needs to know what we did wrong. Once we have mastered the computer, we may confi- dently demonstrate our skill to all who will join in. When we learn to ride a bicycle or drive a car, someone is bound to know and we may be· humiliated. This need not be the case with the computer. The computer will keep its secret if you will keep yours. The computer has truly infinite patience and will never raise its voice. Learning to program a computer is not so complicated. You will prob- ably find that an iterative process works best. Read some of the text, try some programs on the computer, and go back to read some more. There are certain things that you cannot possibly know without being told and certain things that make sense based on what is known so far. You will find that reading the text will help with writing the next program and that writing and executing a program will help with reading the text. A program consists ofa set of instructions that causes the computer to perform a task of our choosing. The process of writing those instructions for the computer is called programming. Programs do an amazing variety

Reading notes: Source text ends mid-sentence at 'Programs do an amazing variety' No primary printed heading is present; headline set to null

Languages
English
PDF page 9

of things. You may perform the simplest of arithmetic calculations or the most complex of mathematical manipulations. You can write programs to interact with the user. You may want to do this to make the computer play a game or to fill out a tax return. You may write a computer program to solve an algebra homework problem or organize a directory of names and addresses of your friends or business associates. And you may even be programming a computer just for the fun of it. I hope that you are soon stimulated by your work in programming to bring to the computer your new and exciting problems to be solved. Above all, to be successful, you will have to be an active participant. Actually write programs and execute them. Then try to see how what you have learned fits into the picture of the BASIC language and programming in general.

Languages
English
PDF page 10

Contents Chapter 1 Gttttillg Stll.J:'tttd............................................ J. ... Introduction to Programming ................................................ ""......... 2 1·1 ... Displ~g Messages (PRINT a.nd LPRINT)................................ 2 ... RlJN (Executing a. Program) ............................................................... 3 ... LIST a.nd LLIST ........................................................................................... 3 .•• NEW................................................................................................................... 6 ...Line Numbers.............................................................................................. 6 ... DELETE ........................................................................._................................ 7 ...At the Keyboard.......................................................................................... 8 ... SUMMARY ..................................................................................................... 8 Problems for Section 1-1 ....................................................................................... 9 1·8 ... Ca.lculations.................................................................................................. 9 ...SUMMARY..................................................................................................... 11 Problems for Section 1-2....................................................................................... 12 llitlttlJ.~:t; ]................................................................... 111 ... HOME ............................................................................................................... 12 ...Question Mark(?) in PRINT............................................................... 12 Chapter a Jlddillg l!'eatl11-e11.......................................... l~ 8·1 .•. More Calculations............................................................................. - 14 ... Number Pigeonholes (Numeric Variables) ................................. 16 ...The Assignment Statement (LET) .................................................... 16 ... Optional LET........................................................................................... _. 17 •.. READ a.nd DATA............................................_........................................... 17 ...Entering Values from the Keyboard (INPUT)........................... 18

Reading notes: Heavy OCR damage in chapter titles and several table-of-contents entries Section numbering and some headings are garbled, such as 'Gttttillg Stll.J:'tttd' and 'Jlddillg l!'eatl11-e11' Page numbers and some line-leader punctuation are uncertain

Languages
English
PDF page 11

.... PBIN'T USING and J,PBIN'T USING................................................... 19 ••. Multiple INPUT and Multiple BEAD................................................ 21 ••. BESTOBE........................................................................................................ 22 •.. SUMMA.BY ..................................................................................................... 22 Problems for Section 2-1 ........................................................................................ 23 8·8 ...Additional .Arithmetic Opera.tors...................................................... 23 •.. Order of Operations ..............................................................................,... 23 ••. Ra.ising to a. Power....................................................................... ""........... 24 ••. MODula.r Arithmetic................................................................................ 24 ... Integer Division. ......................................................................................... 28 Problems for Section 2-2 ........................................................... , ......................_. 28 1-S .•. More Messages .......................................................................................-.. 26 ••• Word Pigeonholes (String Va.ria.bles) ............................................. 26 •• .Adding. Strings (Conca.tena.tion)....................................................... 28 •.. SUMMARY ......•.......•.•...• -.............................................................................. 29 Problems for Section 2-3 ...................................................................... ~................ 29 814eJ1Cht a CA Word about Precision)........................ ae ••. Single Precision.......................................................................................... 29 •.. E-forma.t.......................................................................................................... 30 ••. The Biggest Number? .............................................................................. 31 Chapter 3 lll':ritiJlt& a ~e>tira111....................................... a.a 8·1 ...Do It .Again .................................................................................................... 32 ••. Our First Counting Program. .............................................................. 32 ••• GOTO ................................................................................................................. 33 •.. IF . . . THEN....................................... -. .............................. -...................... 34 ••. Comma. Spacing .........................................................:................................ 37 •.. SUMMA.BY ..................................................................................................... 38 Problems for Section 3-1 ....................................................................................... 38 8·8 ...Do It Again (When We :pon't Know How Ma.ey')..................... 38 ••. A Little Planning........................................................................................ 39 •.. BEMa.rk........................................................................................................... 39 ••. END .............................................................................. -. .................................. 43 ••. IF . . . THEN Revisited.......................................................................... 44 ••• STOP .................................................................................................................. 44 .••. SUMMARY ................................................................................................._ 44 Problems for Section 3-2 ..........................................................................-......... 48 8·8 .•. IF • • • THEN . • . ELSE......................................................................... 48 •.• Multiple Statements on One Line (: ) ......................."".................... 48 ••• Multiple Lines per Statement (CTBL-J) ........................................ 47

Reading notes: Table of contents with OCR damage in several entries (e.g., 'J,PBIN'T USING', 'BESTOBE', 'MODula.r'), spelling and character errors likely from scanning. Page numbers and section markers are partially garbled and uncertain. Reading order is a table of contents fragment, not a headed document.

Languages
English