# Apple Basic Data File Programming 1982 — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/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-apple-basic-data-file-programming-1982-c86c6f/1#scan-717da98238348f79d4f567f4abd459ecdf63eb2ca5ffc08d1e4bff8c35b4158f)

Transcribed text:

APPLE® BASIC: DATA FILE PROGRAMMING
A SELF-TEACHING GUIDE
Save time and errors!
The programs in this book are available on 5¼" disk—ready for instant use.
Buy at your favorite computer store or use the order card inside.
LeROY FINKEL
JERALD R. BROWN

Image description: A book cover with a repeating blue background pattern of 'DATA FILES BY FINKEL & BROWN' text, a large torn-paper red apple with olive-green leaves, bold white title type at top, and a small logo in the bottom-left corner.

Reading notes: Background repeated text 'DATA FILES BY FINKEL & BROWN' is partially obscured and was not transcribed as primary copy. Small logo in bottom-left corner contains no legible text. Trademark symbol after APPLE rendered as ® in headline.

Printed product names: Apple BASIC

Languages: English

[Original Image 1](https://www.vintageapple.net/files/53aa8dd57153100f93b1d508f34561a01d6ba5d4a4f1b1f3f8a15d8707a42b7d/058a57f8d074cdd968a68b68.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-499ca2d187b954a16e9e9d1a08108bbcef3bf5422d053220d9456224d9310155)

APPLE BASIC: DATA FILE PROGRAMMING

Transcribed text:

APPLE® BASIC: DATA FILE PROGRAMMING
A SELF-TEACHING GUIDE
Save time and errors!
The programs in this book are available on 5¼" disk—ready for instant use. Buy at your favorite computer store or use the order card inside.
LeROY FINKEL
JERALD R. BROWN

Image description: A book cover with a repeated dark blue background pattern of 'DATA FILES BY FINKEL & BROWN' text, bold white title type, and a torn-paper red apple with olive-green leaves holding a white caption box.

Reading notes: Background repeated text 'DATA FILES BY FINKEL & BROWN' is partially visible and overlapped by the title; not transcribed as primary copy. The small logo in the lower left corner is not transcribed. The ® symbol after APPLE is rendered as a superscript circled R.

Printed product names: Apple BASIC

Languages: English

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

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-e3c8c0ca8ec665eff0799514d799ee33bed30202918bd6587bf17d91eb5c4265)

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

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

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-b50b9c96cb33ed099599ec88b2fb982e541126b37ca3aacb8686eb115460a976)

Transcribed text:

More than a million people have learned to program, use, and   enjoy   microcomputers
with   Wiley paperback guides.   Look for them   all   at your favorite bookshop or
computer store:
BASIC; 2nd ed., Albrecht, Finkel, & Brown
BASIC for Home Computers, Albrecht, Finkel, & Brown
TRS-80   BASIC, Albrecht.,   Inman,·&   Zamora
More   TRS-80   BASIC, Inman, Zamora, & Albrecht
ATARI.BASIC,   Albrecl:tt,   Finkel, & Brown
Data File Programming in BASIC, Finkel & Brown
Data File Programming for the Apple Computer, Finkel & Brown
ATARI Sound & Graphics, Moore, Lo.wer, & Albrecht
Using   CP/M, Fernandez & Ashley
Introduction to   8080/8085   Assembly   Langu~ge   Programming,   Fernandez & Ashley
8080/Z80   Assembly Language, Miller
Personal Computing, McGlynn
·   Why Do   You   Need a Personal Computer? Leventhal & Stafford
Problem-Solving on the   TRS-80   Pocket Computer, Inman & Conlan
Using   Programmable Calculators for Business, Hohenstein
·   How to Buy the Right Small Business Computer System, Smolin
The   TRS-80   Means Business, Lewis
ANS   COBOL,   2nd ed., Ashley
Structured   COBOL,   Ashley
FORTRAN   IV, 2nd ed., Friedmann, Greenberg, & Hoffberg
Job Control Language, Ashley & Fernandez
Background Math for a Computer World, 2nd ed., Ashley
Flowcharting, Stern
Introduction   fo   Data Professing, 2nd ed., Harris

Reading notes: Some OCR-like character corruption in author names (e.g., 'Albrecl:tt', 'Lo.wer', 'Albrecht.,') and titles ('Introduction fo Data Professing'). Bullet markers and layout make it unclear whether some entries are separate titles or continuations.

Printed product names: BASIC; 2nd ed., Albrecht, Finkel, & Brown · BASIC for Home Computers, Albrecht, Finkel, & Brown · TRS-80 BASIC, Albrecht., Inman, & Zamora · More TRS-80 BASIC, Inman, Zamora, & Albrecht · ATARI.BASIC, Albrecl:tt, Finkel, & Brown · Data File Programming in BASIC, Finkel & Brown · Data File Programming for the Apple Computer, Finkel & Brown · ATARI Sound & Graphics, Moore, Lo.wer, & Albrecht · Using CP/M, Fernandez & Ashley · 8080/Z80 Assembly Language, Miller · Personal Computing, McGlynn · Why Do You Need a Personal Computer? Leventhal & Stafford · Problem-Solving on the TRS-80 Pocket Computer, Inman & Conlan · Using Programmable Calculators for Business, Hohenstein · How to Buy the Right Small Business Computer System, Smolin · The TRS-80 Means Business, Lewis · ANS COBOL, 2nd ed., Ashley · Structured COBOL, Ashley · FORTRAN IV, 2nd ed., Friedmann, Greenberg, & Hoffberg · Job Control Language, Ashley & Fernandez · Background Math for a Computer World, 2nd ed., Ashley · Flowcharting, Stern · Introduction fo Data Professing, 2nd ed., Harris

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/ba612ad260c9e8703f810840a5c50c86a6e852b1be0462ec1ae777ee922d085a/c86c6f46b035e9d59544afedf7b19a3853f1cd304d4ebaf039b906a0d3712e5f.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-3f277afac3fa5c5ba6944f1f6ae786d1b731e89bcb972fc2f95e20b42ff6803d)

APPLE® BASIC: DATA FILE PROGRAMMING

Transcribed text:

APPLE®   BASIC:
DATA FILE PROGRAMMING
LEROY   FINKEL
San   Carlos   High School
and
JERALD R.   BROWN
Educational Consultant
John Wiley & Sons, Inc.
New   York   •   Chichester   •   Brisbane   •   Toronto   •   Singapore

Printed product names: Apple

Languages: English

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

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-d5097a183e14a2cf41cebfd26e9956af7cac41fb3781d86412814a949b065bd0)

Transcribed text:

Publisher: Judy V.Wilson
Editor: Dianne Littwin
Composition and Make-up: Trotta Composition
Copyright © 1982, by John Wiley   &   Sons,   Inc.
All rights reserved.   Published   simultaneously in Canada.
Reproduction or translation of any part of this work
beyond that permitted by Sections   107   or   108   of the 1976
United   States Copyright Act without the permission of
the copyright owner   is   unlawful. Requests for permission
or further information should be   addressed   to   the
.   PermisSions   Department, John Wiley   &   Sons,   Inc.
Library of   Congress   Cataloging in Publication Data
Finkel, LeRoy.
Apple BASIC, data ftle programming.
(Wiley self-teaching guides)
Includes index.
1. Basic (Computer-program language) 2. Apple
computer-Programming.   I.   Brown, Jerald, 1940-
11. Title. III. Series: Self-teaching guide.
QA76.73.B3F52   001.64'24   81-13100
ISBN   0-471-09157-X
Pripted   in the   United   States   of America
82   83   10   9   8   7   6   s.

Reading notes: Headline is not clearly identifiable; no primary heading appears in the copy. Some characters appear damaged or garbled, such as 'ftle' and 'Pripted' and 'II.' and 's.' Printed dates list includes both 1982 copyright years and a 1981 catalog number reference; ISBN and catalog numbers are not treated as dates.

Printed product names: Apple

Printed dates: 1982 · 1976 · 1940

Languages: English

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

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-faaaf1c10bfb0c623646c5c93f77f4e236dfe82f7758d597baae0823a57562e2)

How To Use This Book

Transcribed text:

How To   Use   This Book
When you use the self-instruction   f<,mnat   in this book, you will be actively involved in
learning data file programming in APPLESOFf* BASIC   ..   Most of the material is
presented in sections called frames, each of which teaches you something new   oi
provides practice.   Each frame also gives you questions to answer or asks you to
write a   pmgram   or program segment.
You   will learn best if you actually write out the answers and try the programs
on your APPLE II computer (with at least one disk drive).   The questions are carefully
designed to call your attention to important points in the examples and explanations
and to   help·   apply what is being explained or demonstrated.
Each chapter begins with a list of objectives -   what you   will   be able to do after
completing that chapter.   At the end of each chapter is a self-test to provide valuable
practice.
The self-test can be used as a review of the material covered in the chapter.   You
can test yourself immediately after reading the chapter.   Or   you can read a chapter,
take a break, and save the self-test as a review before you begin the next chapter.   At
the end of the book is a final self-test to assess your overall understanding of data file
programming.
This book is designed to be used with an APPLE computer close at hand.   What .
you learn will be theoretical only until you actually sit down at a computer and apply
your knowledge   "hands-on."   We strongly recommend that you and this book get
together with a computer!   Learning   data   file programming in   BASIC   will be easier
and clearer if you have regular access to a computer so you can try the examples and
exercises, make your own modifications, and invent programs for your own purposes.
You   are now ready to teach yourself to use data files in   BASIC.
*APPLE and   APPLESOFf   are registered trademarks of Apple Computer, Inc.
v
.   -

Reading notes: OCR artifacts such as 'f<,mnat' and 'SOFf*' in the source may be damaged characters Possible OCR errors in the word 'pmgram' and 'help·' in the body copy

Printed product names: APPLE II · APPLE

Languages: English

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

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-c05a8f02275cd19f4963b5f2ef174183663e8c6e84a79f5de032f5724fe6a68e)

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

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

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-3404f0c0079aeaa3c64b1ec9c39674a05bbf359ebb074ded6d617df3ee8d363d)

Transcribed text:

Preface
Titls   text will teach you to program data files in   APPLESOFT   BASIC.   As a   pre-
requisite to its   use,   you should have already completed an introductory   course   or
book in   BASIC   programming and be able to read program listings and write simple
programs:   This is not a book for the absolute novice in   BASIC.   You   should already
be comfortable writing your own programs that use statements including string   vari-
ables, string functions, and arrays.   We do start the book with a review of statements
that you already know, though we cover them in more depth and show you new ways
to   use them.
The book is designed for use by readers who have little or no experience using
data files in   BASIC   (or elsewhere, for that matter).   We take you slowly   and   carefully
through experiences that   "teach   by   doing."   You   will be asked to complete many
programs and program   segments~   By doing so, you will learn the essentials and a lot
more.   If   you already have data file experience, you can use this   book   to learn about
data files in more depth.
The particular data files explained in this text are for   APPLESOFT   BASIC.   Data
files in other versions of   BASIC   will be similar, but not identical, to those taught in
this book.*   You   will find this book most useful when used in conjunction with the
reference manual for your computer system.
Data files are used   to·store   quantities of information that you may want to use
now and later; for example, mailing addresses, numeric or statistical information, or
tax and bookkeeping data.   The examples presented in this book will help you use
files for home applications, for home business applications, and for your small
business or profession.   When you have completed this book, you will be able to
write your   owri   programs, modify programs purchased from commercial sources,. and
adapt programs using data files that you   find   in magazines and other sources.
*For   programrriing   data files in   TRS-80   BASIC,   MICROSOFf   BASIC-80, and Northstar BASIC, read our
other book,   Data File Programming in   BASIC   by Finkel and Brown (John Wiley   &   Sons, Inc.,   N.Y.,   1981).
For programming data files on the IBM   PC,   read   IBM PC: Data File Programming   by Brown and Finkel
(John Wiley   &   Sons, Inc.,   N.Y.,   1983).
vii

Reading notes: Possible OCR spacing and punctuation errors in the source text (e.g., 'Titls', 'MICROSOFf', 'vari-able') Footnote text is partially merged with main text in the copy

Printed product names: APPLESOFT BASIC · BASIC · TRS-80 BASIC · Northstar BASIC · IBM PC

Printed dates: 1981 · 1983

Languages: English

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

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-78c507b837e696a0b1a73c661187c7ab8ac434be0fa808f35c8c51ac0ad72fde)

Transcribed text:

Contents
Chapter 1   Writing   BASIC   Programs for Clarity, Readability,
and Logic   1
Chapter 2   An Important Review of   BASIC   Statements   15
Chapter 3   Building   'Data   Entry and Error   Checking   Routines   49
Chapter 4   Creating and Reading Back Sequential Data Files   79
'
Chapter   5   Sequential Data File Utility Programs   134
Chapter 6   Random Access Data Files   198
Chapter 7   Random Access File Applications   252
Final Self-Test   281
Appendix A   ASCII   Chart Code   294
Appendix B   List of Programs   296
Index   302
ix

Reading notes: Stray apostrophe characters appear between entries near Chapter 4 and Chapter 5, possibly OCR artifacts.

Languages: English

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

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-290c6035d4179b6bb8dd9e85b463d214e4c22efcfe54f300d0716ab73b135680)

Writing BASIC Programs for Clarity, Readability, and Logic

Transcribed text:

CHAPTER   ONE
Writing   BASIC   Programs   for
Clarity,   Readability~   and Logic
Objectives: When   you   have completed this chapter you will be able to:
1.   ·describe   how a program can be written using a top-to-bottom format.
2.   write an introductory module using REMARK statements.
3.   ·describe   seven rules to write programs   ·that   save memory space.
INTRODUCTION
_This   text will teach you to use data files in   APPLESOFT   BASIC.   You   should have
already completed an introductory course or book in   BASIC   prograniming, and be able
to read program listings and write simple programs.   This is not a book for the   abso-
lute novice in   BASIC,   but is for those who have never used data files in   BASIC   (or
elsewhere, for that matter).   The particular data files explained in this text are for the
APPLE II computer and the   BASIC   languages found on it.
Data files   in   other versions of   BASIC   and for other computers   will   be similar,
but not identical, to   those   in this book.   (If you are using a computer other than the
APPLE   II, you may want to read.Data   Files Programming in   BASIC,   or   IBM   PC: Data
File Programming,   available at your local computer   store   or bookstore.)   You   will find
this text most useful when used in conjunction with the   APPLE   II reference manuals and
the Disk   Operating   System   (DOS)   Manual: It is   not   a substitute for your careful reading
of the   APPLE   II   DOS   Manual, though the workings of sequential and random access
files are explained here in far more depth and with more examples.
Since it is assumed you have some knowledge of programming in   BA~IC   and have
practiced by writing small programs., the next step is for you to begin thinking about
program organization and clarity.   Because data file programs   can:   become fairly large
and complex, the inevitable   de\:mgging   process -   making the program actually work
·-   can be proportionately complex. Therefore, this chapter is important to you   be-
cause it provides some program organization methods to help make your future
programming easier   ..
1

Reading notes: OCR-style spacing and punctuation irregularities in the source (e.g., 'prograniming', 'BA~IC', 'Data Files Programming in BASIC') Possible garbled characters in 'BA~IC' and 'prograniming' that may be OCR errors

Languages: English

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

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/1#scan-711af62575062c615d369141bde2c3c5b5b6b9c57031361428d0ccfe1c4a5a81)

2. APPLE BASIC: DATA FILE PROGRAMMING

Transcribed text:

2.   APPLE   BASIC: DATA   FILE   PROGRAMMING
THE.   BASIC   LANGUAGE
The computer language called   BASIC   was developed at Dartmouth   College   in the early
1960s.   It   was   intended for use by people with. little or no previous computer   experi-
ence   who   were not necessarily adept at mathematics.   The   original   language syntax
included only those functions that a beginner would need.   As other colleges, computer
manufacturers, and institutions began to adopt   BASIC,   they added embellishments to
μieet   their own needs.   Soon   BASIC   grew   in   syntax to what various sources called
Extended   BASIC,   Expanded   BASIC,   SUPERBASIC,   XBASIC,   BASIC   PLUS,   and so   0!1·
Finally, in 1978 an industry standard was developed for   BASIC,   but that standard was
for only a   "minimal   BASIC,"   as defined by the American National Standards Institute
{ANSI).   Despite·   the   ANSI   standard, today we have a plethora of different   BASIC
langu~ges,   most of which   "look   alike,"   but each with its own special characteristics
and quirks.   ·
In   the microcomputer field, the most widely used versions of   BASIC   were
developed by the Microsoft   Company   and are generally referred to as   MICROSOFT
BASICs.   These BASICs are available on a variety of microcomputers but, unfortu-
nately, the language is   implemented   differently on each computer system.   The
APPLE version of   MICROSOFT   BASIC is called   APPLESOFT.
.   The programs   and·   runs shown in this text were   ·actually   performed on an
APPLE II and an APPLE II   PLUS   computer using Disk Operating System   (DOS)   3.3.
{They   will   work in   .DOS   3.2, as well.)   We wrote all of our programs using   APPLE-
SOFT   BASIC.   To use the programs in INTEGER BASIC, you will have to   ma).ce   the
usual   APPLESOFT   to INTEGER modifications described in your reference manual.
The file commands described in this text may be used in   APPLESOFT   or INTEGER
BASIC.   For INTEGER BASIC you may have to modify the file .input and output
statements, as described in your   DOS   Manual.   ·   ·
Where possible, we use BASIC language features   that   are common to all versions
of BASIC, regardless of manufacturer.   We do nc:it attempt to show off all of the   ·
bells and whistles found in   APPLESOFT   BASIC, but rather to present easy-to-under-
stand programs that   will   be readily adaptable to a variety of   computers.
I
THE BASIC   LANGUAGE   YOU   SHOULD   USE
Conservative Programming
Since you   will   now be writing longer and more complex programs,   you should adopt
conservative   programming techniques so that e"ors will be easier to isolate and locate.
(Yes, you   will   still make errors.   We all do!)   This means that you should   NOT   use
all the fanciest features available in   APPLESOFT   BASIC until you have tested the
features to be sure they work the way you think they work.   Even then, you still
might decide against using the fancy features, many of which relate to printing or
graphic output and do not work the same on other computers.   Some·   are special
functions that   simply   do not exist on other computers.   Leave them out of your
programs unless you feel you must include them.   The   more   conservative your   pro-
gramming techniques, the less chance there is of running into a software   "glitch.   "

Reading notes: Possible OCR artifacts in the source, e.g. 'μieet' and '0!1·' and 'langu~ges', may affect exact spelling. Some words are hyphenated across line breaks (e.g. 'experi-ence', 'under-stand'), so reading order is reconstructed.

Printed product names: APPLE II · APPLE II PLUS · DOS · APPLESOFT · INTEGER BASIC · BASIC · MICROSOFT BASIC · DOS 3.3 · DOS 3.2 · DOS Manual

Printed dates: 1960s · 1978

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/ba612ad260c9e8703f810840a5c50c86a6e852b1be0462ec1ae777ee922d085a/c86c6f46b035e9d59544afedf7b19a3853f1cd304d4ebaf039b906a0d3712e5f.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-apple-basic-data-file-programming-1982-c86c6f/2.md)
