Mastering VisiCalc
From the originals
18 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.
PDF page 12
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. xv
- Printed product names
- VisiCalc · BASIC · Apple · IBM Personal Computer
- Languages
- English
PDF page 137
126 MASTERING VISICALC Position the cursor at A6 (which contains the label "HONOLU- LU") and enter the following sequence of commands: IS# {invoke the DIF storage command} S {to save a DIF file} RAIN.DIF~ {enter the file name} N15(return) {the lower-right position} R {to save the data by rows} Notice we are calling this file RAIN.DIF. For the purpose of examining a DIF file, we can write a simple BASIC program that will display the contents of such a file on the screen of your computer. In the next section of this chapter we will look at a display of RAIN.DIF. Then, in the following section we will study the BASIC program that created the display. THE STRUCTURE OF DIF FILES The display of the file RAIN .DIF appears in Figure 6.3. (Due to space constraints, the figure is arranged in arbitrary columns; but remember that the data represents one continuous file.) Take a brief look at it before we begin studying it in detail. You can easily spot all the data from the rainfall spreadsheet-first, the names of the cities, and then the rainfall values, taken from the columns of the original spreadsheet. But the rainfall values are interspersed with many other data items that do not make any immediate sense; these items are what we have described as the self- documentation feature of DIF files. They describe the contents of the file itself, and are designed for the convenience of the pro- gram that will read the file. As we study these items, a few of them may seem arbitrary and extraneous. This is partly because the DIF file format is designed to be flexible; some of the data items allow for eventual expanded uses of DIF. What you see in Figure 6.3 is the DIF format that the VisiCalc program can read and write. Other programs that also use DIF may have other requirements. The DIF file consists of many short lines of text. Some lines con- tain two pieces of data(separated by commas), and others contain only one. We will see that many of the items in the file act as markers. Some markers divide up different sections of the file, and others serve as "flags" to indicate what kind of information is
Reading notes: Source text contains hyphenation and spacing artifacts such as 'HONOLU-LU' and 'RAIN .DIF'.
- Printed product names
- VisiCalc · DIF
- Languages
- English
PDF page 138
TABLE 0, 1 "" VECTOJIS o, 10 "" TUPLES o, 14 "" DATA o,o nn -1,0 BOT 1,0 "HONOLULU" 1,0 "LOS ANGL" 1,0 "SAN FRAN" 1,0 "DENVER" 1,0 "ST.LOUIS" 1,0 "NEW ORLN" 1,0 "CLEVELND" 1,0 "MIAMI" 1,0 "WASH DC" 1,0 "NEW YORK" -1,0 BOT 0,11.18 v 0,7.62 v 0,11.18 v 0,1.52 v 0,4.83 v 0,11.43 v o,6.6 v 0.5.59 v o,6.6 v 0,6.86 v DIF FILES, PART I: AN INTRODUCTION 127 -1,0 BOT 0,6.35 v 0,1.11 v 0,7.62 v 0,1.78 v 0,5.33 v o, 11.68 v 0,5.59 v 0,5.08 v 0,6.35 v 0,7.37 v -1,0 BOT 0,8.13 v 0,5.59 v 0,6.35 v 0,3.05 v 0,7.62 v o, 13.97 v 0,7.87 v 0,5.33 v 0,8.38 v 0,9.4 v -1,0 BOT 0,3.56 v 0,3.3 v o,4.o6 v o,4.83 v 0,9.91 v 1.--------------Figure 8.3: RAIN.DIF (continues)
Reading notes: Source is machine-garbled tabular data (coordinate and vector values) rather than advertising copy; no headline, product names, prices, or dates are identifiable. City-name fragments such as HONOLULU, LOS ANGL, SAN FRAN, and NEW ORLN are truncated and may be data labels rather than printed copy. Reading order of the numeric records is uncertain.
- Languages
- English
PDF page 139
128 MASTERING VISICALC o, 10.67 v o,8.89 v 0,9.3 v 0,7.37 v 0,8.38 v -1,0 BOT 0,2.54 v 0,.25 v 0,1.02 v o,6.86 v 0,9.91 v o, 10.67 v o,8.89 v 0,15.119 v 0,9.55 v o,8.89 v -1,0 BOT o,.76 v o,o v 0,.25 v o,11.83 v 0,11.18 v 0,11.94 v o,8.38 v 0,22.86 v 0,8.89 v 0,7.62 v -1,0 BOT 0,1.52 v o,o v o,o v 0,4.57 v 0,9.4 v 0,17.02 v 0,3.89 v o, 17 .53 v o, 10.41 v 0,9.11 v -1,0 BOT 0,2.03 v o,o v o,o v 0,3.3 v 0,7.37 v o, 13.46 v 0,1.81 v 0,17.24 v 0,12.09 v 0,10.16 v -1,0 BOT 0,1.78 v o, .51 v 0,.51 v Figure 6.3: HAIN.DIF (continues)-------------__.
Reading notes: Source is a column of numeric data and coordinate-like tokens rather than advertising copy; no headline or products present. OCR fragments such as 'o,' and split numbers (e.g. '17 .53', '13.46') are uncertain. Source ends with a figure caption referring to HAIN.DIF (continues).
- Languages
- English
PDF page 140
DIF FILES, PART I: AN INTRODUCTION 129 0,2.79 o,6.86 v v 0,7.37 0,7.37 v v o, 14.22 0,9.65 v v , ' 0,7.11 -1,0 v BOT •I~ 0,22 .1 0,9.4 v v 0,7.87 0,5.59 v v 0,8.38 o, 10.16 v v -1,0 0,1.02 BOT v 0,3.81 0,5.08 v v 0,.76 0,12.95 v v 0,2.511 0,6.1 v v 0,2.79 o,4.o6 v v 0,7.11 0,7.62 v v o,s.811 o,8.89 v v 0,6.6 -1,0 v BOT 0,20.83 0,58.68 v v o,6.86 0,35.81 v v 0,7.37 0,49.53 v v -1,0 0,39.37 BOT v 0,7.62 0,91.116 v v o,s.08 0,1113.76 v v o,s.811 o,s11.9 v v 0,2.03 0,152.27 v v o,6.35 0,99.36 v v 0,9.91 0,102.37 v v 0,7.11 -1,0 v EOD '--------------------Figure 6.3: BAIN.DIF
Reading notes: Source text consists mainly of numeric coordinate-like fragments and markers (v, BOT, EOD) with no legible prose advertising copy. Caption 'Figure 6.3: BAIN.DIF' is the only legible text and is not a primary heading. Some numeric values contain apparent OCR damage such as 'o' in place of zero and '1113.76'.
PDF page 141
MASTERING VISICALC
130 MASTERING VISICALC coming up in the file. These markers are like the colored plastic dividers that you put in a looseleaf notebook. They allow you to see where one section ends and another begins, and they identify the contents of different sections. Let's begin looking at the file in detail. The file is actually divided into two main parts. The first part, called the header, contains information about the way the data is organized. The second part, called the data part, stores the data itself. The header of the file in Figure 6.3 consists of the first twelve lines of data: TABLE 0, l ,,,, VECTORS 0, 10 TUPLES 0, 14 ,,,, DATA 0, l ,,,, There are four different items in this header, each item containing three lines of data. The first line of each item is a descriptive title; the second line contains two numbers; and the third line is a string value. (A string is simply a nonnumeric value-another word for what VisiCalc calls a label.) Notice that all four of the strings in this header item are empty strings, represented by a pair of quotation marks with nothing between them. We can look at this header section from two points of view. Remember that we will be writing one BASIC program that only needs to read a DIF file, and another that will have the task of writing a DIF file to return data to the VisiCalc program. From the point of view of a BASIC program that reads the file, there are exactly two relevant pieces of information in the header. (We will see in a moment which two items these are.) All the rest of the data can simply be read and forgotten. We will refer to this irrelevant data as "garbage." However, in order to read a DIF file successfully, the VisiCalc program requires this precise header format. What is
Reading notes: Running page header and page number are partially merged with body text; reading order may be affected at the top of the excerpt.
- Printed product names
- VisiCalc
- Languages
- English