Mastering Visicalc 1983.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
MASTERING VISICALC MASTERING VISICALC Douglas Hergert Berkeley • Paris • Dtisseldorf Cover art by Daniel Le Noury Layout and design by Ingrid Owen Apple is a registered trademark of Apple Computer, Inc. DIF is a trademark of Software Arts. Inc. IBM is a registered trademark of International Business Machines Corporation. TRS-80 is a trademark of Tandy Corporation. VisiCalc is a registered trademark of VisiCorp, Inc. 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. © 1983 SYBEX Inc., 2344 Sixth Street, Berkeley, CA 94710. World Rights reserved. No part of this publication may be stored in a retrieval system, transmitted, or reproduced in any way, including but not limited to photocopy, photograph, magnetic or other record, without the prior agreement and written permission of the publisher. Library of Congress Card Number: 82-62005 ISBN D-89588-090-3 Printed in the United States of America 10 9 8 7 6 5 4 3 2 ·~o 11:1Y parents vii TABLE OF CONTENTS Acknowledgements xi Introduction xiii THE VISICALC PROGRAM 1 AND YOUR COMPUTER 1 Introduction 1 What VisiCalc Can Do for You 2 VisiCalc at Home 4 VisiCalc at the Office 6 The Scientific VisiCalc 9 A Quick Look at Things to Come 11 Versions of the VisiCalc Program 14 Memory 15 VisiCalc and BASIC 16 The Operating System 17 Other Spreadsheet Programs 18 Summary 19 AN INTRODUCTION 2 TO THE VISICALC PROGRAM 20 Window on the Spreadsheet 21 Your Keyboard 24 Moving the Cursor ... Adjusting the Window 25 Entering Data 29 Editing Data-The IE Command 32 Clear the Screen and Start Over . 33 Controlling the Spreadsheet 35 Writing Formulas 42 Replicating Formulas 45 More on Replication 47 Windows and Graphics 49 Storing Spreadsheets-/SS and /SL 52 Summary 54 viii 3 VISICALC FUNCTIONS, PART I 56 How to Use Functions 5 7 The Arithmetic Functions 62 The Advanced Mathematical Functions 70 Summary 73 4 VISICALC FUNCTIONS, PART II 74 The @LOOKUP and @CHOOSE Functions 75 The Logical Functions 81 Getting Along without the Logical Functions 88 Summary 92 5 PLANNING VISICALC SPREADSHEETS 94 Generalized Spreadsheets: Formulas without Data 95 The @NA Function and the /GR Command 97 The /GO Command 107 The Net Present Value 109 The @ERROR and @ISERROR Functions 111 Examining ''Scenarios'' 112 Summary 115 6 DIF FILES, PART I: AN INTRODUCTION 116 The Uses of DIF Files 117 Transferring Data Between Spreadsheets 120 The Rainfall Spreadsheet 124 The Structure of DIF Files 126 A BASIC Program for Displaying DIF Files 136 The File-Handling Subroutines 140 Summary 142 7 DIF FILES, PART II: READING A DIF FILE FROM BASIC 144 When Not to Use VisiCalc 145 Statistics from the Rainfall Spreadsheet 148 Storing a DIF File in BASIC 150 The Statistics Subroutine 154 Summary 155 ix 8 DIF FILES, PART III: WRITING A DIF FILE FROM BASIC 158 Returning Da:ta to VisiCalc 159 A Sorting Program for DIF Files 160 The Structure of the Program 167 The Sort Subroutine 170 The DIF File Creation Subroutine 172 Summary 174 APPENDICES A FILE-HANDLING SUBROUTINES FOR THREE POPULAR PERSONAL COMPUTERS 176 Introduction 177 Apple® BASIC 177 TRS-80™ BASIC 178 IBM® Personal Computer BASIC 180 B A BRIEF LOOK AT BASIC 182 Introduction 183 What Is a BASIC Program? 183 Storing Data in BASIC 186 Arrays in BASIC 189 Input and Output in BASIC 190 Controlling a BASIC Program 195 Functions in BASIC 204 The ASCII Code 205 C SPECIAL KEYBOARD COMMANDS 208 Introduction 209 Apple® II 209 TRS-80™, Models I and III 210 IBM® Personal Computer 210 Bibliography 213 Index 215 xi ACKNOWLEDGEMENTS Sincere thanks go to Salley Oberlin and Elaine Foster for their technical, editorial, and moral support during the prepara tion of this book. I also want to thank the following members of the Sybex production staff for their sensitive work: Valerie Brewster, Margaret Cusick, Michael Howard, Sharon Leong, Ingrid Owen, Donna Scanlon, Hilda van Genderen, and Cheryl Wilcox. xiii INTRODUCTION The "electronic spreadsheet" programs have quickly become one of the leading software applications for use on personal com puters. These programs give us the capability to process hundreds of numbers at once, to find patterns, draw conclusions, and explore alternatives suggested by any kind of numerical data. Their power applies itself as well to the small numerical chores of private life as to the larger record-keeping, decision-making jobs of professional life. And most appealing of all, using these programs requires scarcely more technical knowledge or mathematical skill than is needed to operate a pocket calculator. The VisiCalc® program, written by Software Arts, Inc., is certainly one of the best and most popular of these spreadsheet programs. Available for most of the major microcomputers on the market today, the VisiCalc program demonstrates the two most important qualities of the electronic spreadsheet: it is easy to use, yet flexible and versatile enough to solve a wide range of technical or nontechnical tasks. Even more importantly, the creators of the VisiCalc program have taken the initiative to design a spreadsheet program that can share data easily and reliably with the other software tools that reside in the same microcomputer environment. This kind of out ward friendliness is rare in the world of commercial software; too many programs are designed, intentionally, to be unapproachable, uncooperative, and monolithic with respect to other, competing, programs. Mastering VisiCalc, then, is written for several levels of use: • If you are a newcomer to the VisiCalc program, this book will guide you through the first steps of learning how to use the program for your own individual needs. You will find out how to enter data, and how to take advantage of all the major VisiCalc features. xiv • If you have already started using the VisiCalc program, but still have questions about some of its more advanced fea tures, this book will be useful to you. You will find insight into the subtleties of the more difficult functions-such as @LOOKUP, @NVP, and the logical functions-and you will learn techniques for optimal use of the VisiCalc program. • Finally, if you are ready to expand outward and begin using the VisiCalc program with other programs of your own design, this book offers a complete introduction to the use of DIFTM files for communicating data between VisiCalc and BASIC. Mastering this feature can be a challenge; but in the end, you will profit from vastly in creased control over the data processing tasks you perform on your computer. Chapter 1-The VisiCalc Program and Your Computer-sets the scene of this book. It presents several examples of what VisiCalc can do, and offers you a quick overview of the features of the program. Chapter 2-An Introduction to the VisiCalc Program-gives you a complete, hands-on guided tour through the major VisiCalc commands. It shows you how to enter data, write formulas, and apply those formulas to entire rows and columns of data. Chapter 3-VisiCalc Functions, Part I-teaches you how to use the most common functions, such as @SUM and @AVERAGE, and gives you an opportunity to study the action of the more advanced mathematical functions. Chapter 4-VisiCalc Functions, Part II-helps you to explore the use of @LOOKUP and the logical functions, which sometimes seem mysterious to the beginner. Since some versions of the VisiCalc program do not include the logical functions, this chapter suggests several alternative techniques that can be used to simulate these functions. Chapter 5-Planning VisiCalc Spreadsheets-is an essential chapter for all readers. It shows you how to develop generalized spreadsheets that will be of long-term value rather than one-time use. It also clarifies some potentially confusing concepts involving the way VisiCalc performs spreadsheet calculations. xv The last three chapters of this book introduce DIF files as a means of sharing data between the VisiCalc program and BASIC. If you have never programmed in BASIC, or if you are a relative beginner, you should read Appendix B-A Brief Look at BASIC before beginning these chapters. Chapter 6-DIF Files, Part I-describes and illustrates the struc ture of the Data Interface Format (DIF™). It also presents a BASIC program that will display any DIF file on the screen of your computer. This program, and the programs that follow in Chapters 7 and 8, require certain file-handling facilities that are expressed in different instructions by various versions of BASIC. Appendix A supplies these instructions for the BASICs of three popular personal computers-Apple® ,TRS-80™, and the IBM® Personal Computer. Chapter 7-DIF Files, Part II-discusses situations that may call for the combined powers of VisiCalc and BASIC. This chapter shows you how a BASIC program can achieve access to the data from a VisiCalc spreadsheet. Chapter 8-DIF Files, Part III-illustrates the final step in VisiCalc/BASIC data exchange. This chapter presents a tool that may prove valuable to you for many data processing situations-a BASIC program designed to sort VisiCalc spreadsheet data. In sum, the goals of Mastering VisiCalc are twofold: first, to teach you how to use the VisiCalc program, and second, to help you explore the use of VisiCalc teamed with other programs on your personal computer. CHAPTER ONE THE VISICALC PROGRAM AND YOUR COMPUTER INTRODUCTION This first chapter will give you a preview of what you have in store as a VisiCalc user. All the rest of the chapters in this book concentrate on the details of how to make the VisiCalc program work for you.