← Turbo Pascal for the Mac: Programming with Business Applications

Turbo Pascal for the Mac: Programming with Business Applications

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

TURBO PASCAL FOR THE MAC

2927 TURBO PASCAL® FOR THE MAC PROGRAMMING WITH BUSINESS APPLICATIONS DR. LEON A. WORTMAN TURBO PASCAL MACINTOSH BORLAND INTERNATIONAL PROGRAM DISK D1A0220539 TURBO PASCAL MACINTOSH BORLAND INTERNATIONAL UTILITIES & SAMPLE PROGRAMS TURBO PASCAL® The ultimate Pascal development environment Incredibly fast—compiles more than 12,000 lines a minute! MACINTOSH™ BORLAND

A book cover with large red-outlined white title text on a gray-lavender background, a blue-and-black Turbo Pascal software box, and two 3.5-inch floppy disks labeled Program Disk and Utilities & Sample Programs.

Reading notes: Disk label code D1A0220539 is small and may be imprecise. Small text on the software box and disk labels is blurry and may contain minor errors. The number 2927 at top left is likely a catalog or series number; its role is uncertain.

Printed product names
Turbo Pascal for the Mac · Turbo Pascal
Languages
English
PDF page 1

TURBO PASCAL FOR THE MAC

2927 TURBO PASCAL® FOR THE MAC PROGRAMMING WITH BUSINESS APPLICATIONS DR. LEON A. WORTMAN TURBO PASCAL® The ultimate Pascal development environment Incredibly fast—compiles more than 12,000 lines a minute! MACINTOSH™ BORLAND TURBO PASCAL® MACINTOSH BORLAND INTERNATIONAL PROGRAM DISK D1A0220539 TURBO PASCAL® MACINTOSH BORLAND INTERNATIONAL UTILITIES & SAMPLE PROGRAMS

A book cover with large red-outlined white and black title lettering on a gray background, showing two Turbo Pascal floppy disks and a boxed Turbo Pascal software package with a Macintosh keyboard and a portrait image.

Reading notes: The vertical BORLAND text on the box spine and the small fine print on the disk labels are partially stylized and may have minor reading uncertainty. The disk serial string D1A0220539 is read from a small label and should be checked. Reading order of the cover title elements is inferred from layout.

Printed product names
Turbo Pascal for the Mac · Turbo Pascal
Languages
English
PDF page 2

TURBO PASCAL® FOR THE MAC PROGRAMMING WITH BUSINESS APPLICATIONS

TURBO PASCAL® FOR THE MAC PROGRAMMING WITH BUSINESS APPLICATIONS DR. LEON A. WORTMAN TAB TAB BOOKS Inc. Blue Ridge Summit, PA 17214

A cream-colored title page with large bold italic serif title text, an author name in small caps below, and the TAB Books Inc. publisher logo and address at the bottom.

Reading notes: The registered trademark symbol after PASCAL is a small superscript ®, transcribed here as ®. The TAB logo is rendered as a boxed 'TAB' mark; transcribed as TAB once in the transcript to avoid duplication of the logo text.

Printed product names
Turbo Pascal for the Mac
Languages
English
PDF page 3

Turbo Pascal for the Mac.

Turbo Pascal, Turbo-87, and TurboBCD are trademarks of Borland International, Inc. IBM is a trademark of International Business Machines. Macintosh is a trademark of Apple Computer Corp. FIRST EDITION FIRST PRINTING Copyright © 1987 by Dr . Leon A. Wortman Printed in the United States of America Reproduction or publication of the content in any manner, without express permission of the publisher, is prohibited. No liability is assumed with respect to the use of the information herein. Library of Congress Cataloging in Publication Data Wortman, Leon A. Turbo Pascal for the Mac. Includes index. 1. Turbo Pascal (Computer program) 2. Macintosh (Computer)-Programming . 3. Business-Data processing . I. Title. HF5548.5.P14W67 1987 650'.028 '5416 87-7134 ISBN 0-8306-2927-0 (pbk.) Questions regarding the content of this book should be addressed to: Reader Inquiry Branch Editorial Department TAB BOOKS Inc. P.O. Box 40 Blue Ridge Summit, PA 17214

Reading notes: Catalog number '87-7134' and dewey-style call number '650'.028 '5416' are printed in fragmented spacing and may not be reliably split

Printed product names
Turbo Pascal · Turbo-87 · TurboBCD · Macintosh · IBM
Printed dates
1987 · 87-7134
Languages
English
PDF page 4

CONTENTS Acknowledgment vii Introduction . . . Get Ready! viii 1 ... Get Set! 1 Introduction to Pascal- Turbo and otherwise. 2 ... And Go! 5 Warm up with a series of 14 short programs. 3 HISTOGRAM: A Bar Chart Maker for Graphics Presentations 23 Create histograms; bar charts for your data presentations. 4 CONTRIBUTION: Determining the Contribution to Profit 27 How much does a specific product or service contribute to your profit (or loss)? 5 DA YSCREDIT: Measuring Cash in Float 33 Cash flow and accounts receivable. 6 CHECKBOOK: Excellent Code Practice 41 Keep your checking account records up-to-date. 7 DEPRECIATION: Depreciating Your Capital Assets 53 Three methods for depreciation.

Reading notes: Source text is a table of contents; headline taken as the printed heading CONTENTS Line 'Introduction to Pascal- Turbo and otherwise.' may be an incomplete or garbled chapter description Spacing in 'DA YSCREDIT' may be an OCR artifact for 'DAYSCREDIT'

Languages
English
PDF page 5

8 COUNTWORDS, COUNTSTROKES & COUNTCHARACTERS: Counting Programs 65 Tidy counting programs for text files; continued learning about pro- grammzng. 9 INVESTV AL: Evaluating Investments 73 By what percent of the original value has the current market value of your cash investment changed? 10 LOANPAYMENTS: Mortgage and Loan Tables 79 Create data tables; calculate, display, and print periodic payments, interest and principal amounts. 11 NETWORTH: Calculating Your Net Worth 87 Calculate the difference between what you own and what you owe; string arrays in Turbo Pascal. 12 AUTOREPORT & TRIPREPORT: Generate Detailed Reports of Trip and Automobile Expenses 97 Two programs to generate reports of expenses incurred during trips. 13 SETPRINTER: Send Control Codes to a Printer 113 A menu set of options for sending configuration codes to the Apple Imagewriter or another printer. 14 TIMETREND: Use Time-Trend Analysis to Smooth the Rough Spots 119 Prepare a moving averages table to track business directions. 15 PLOTTER: A Graph with Equidistant Data Points 129 Here's an application for any user who has to plot a series of equidistant data points on a graph. 16 METRICSENGLISH: Use of the CASE Statement in a Program for English/Metric Conversions 139 Choose from a menu of 24 metric-to-English and English-to-metric conversions; precision formulas are built in.

Reading notes: Table of contents listing with program titles and page numbers; no advertised products or prices present Heading line 'Tidy counting programs ... programmzng' contains a likely OCR misspelling of 'programming'

Languages
English
PDF page 6

SORTER: Alphanumeric Sorting

17 SORTER: Alphanumeric Sorting ... Garbage in, Neatness out 147 Sort text and alphanumerics according to the ASCII collating sequence. 18 APPRAISAL: A Personnel Appraisal Program Provides a Good Session in Writing Code 153 Appraise the merits of a manager, supervisor, or employee 19 BREAKEVEN: When Revenues and Costs Come Together 163 Enter costs and prices; program instantly computes the break-even point and generates a comprehensive data table. 20 REPCOMMISSION: A Program for Sales Managers 173 Generate and print a master record of sales revenues and commissions earned, paid out, and still owed to sales reps. 21 SALESREPORT: Analyzing Sales Performance 181 Compute and print sales data, including individual performances and deviations from the averages. 22 MINICALC: A Four-Function Calculator 187 Learn math programming with this four-function calculator, customizable to your specific needs. 23 PRINTERTESTl & PRINTERTEST2: Programs That Will Test and Benchmark Your Printer's Printing Quality 191 Two versions of a program that will put your printer through its paces. 24 COPYIT: Copying and Renaming ASCII Files 199 Copy a file to another disk (or to the same disk) using the same or another "legal" file name; make a hard copy with your printer. 25 PRINTITl & PRINTIT2: Utility Programs to Make Hard Copy Printouts of Your ASCII Files 201 Two programs for listing ASCII files; includes error-handling examples for Turbo Pascal.

Reading notes: Source text appears to be a table of contents; product names PRINTERTESTl and PRINTIT1 may be OCR rendering of 1 as l.

Printed product names
SORTER · APPRAISAL · BREAKEVEN · REPCOMMISSION · SALESREPORT · MINICALC · PRINTERTEST2 · COPYIT · PRINTIT2
Languages
English
PDF page 7

26 SHOWIT: Display a Text File 207 Interactive program to name and disp!,ay text files. 27 TYPEIT: Send Your Typing Directly to the Printer 211 Use your inexpensive Macintosh like an expensive typewriter; an- other lesson in programming. 28 EDITITl, EDITIT2 & EDITIT3: Three Text Editor Programs 215 Line-oriented text editors that become progressively more powerful. 29 START, UPDATE & LISTALL: Essential Elements of a Database Program 223 Three programs that, together, form a study of the structure of a database program. 30 DATABASE!: Database Program with Enhanced 1/0 Error Handling 233 ST ART, UPDATE & LISTALL are converted to procedures to form an integrated database program. 31 DATABASE2: Enhancements to DATABASE! 241 A database program with wider applications. APPENDICES A Turbo Pascal Expressions and Rules 251 B Turbo Pascal and Standard Pascal 257 c Identifiers, Reserved Words, Constants, Variables, and Expressions 261 D Predefined Procedures and Functions 265 E 1/0 Error Handling 271 Index 273

Reading notes: Text 'disp!,ay' appears to contain a typographical error in the source. Text 'EDITITl' may be an OCR misreading of 'EDITIT1'.

Printed product names
Macintosh · Turbo Pascal
Languages
English
PDF page 8

Acknowledgment I am especially grateful to Philippe Kahn and his talented, high-spirited team at Borland International, who continue to amaze us with products that concentrate on speed and economy. Under Kahn's direction, Borland has broken the pattern that was appearing to become the software industry's mold: high prices, doubtful quality, incomprehensible documentation, and nonexistent or grudgingly given customer support. I certainly hope Borland will be able to maintain this "attack" on the software " institution." Borland's business methods have proven that if all else fails, one should try integrity. Borland doesn't even appear to be faced with "failure," only with continual success. vii

Reading notes: Source appears to be a book acknowledgment page rather than an advertisement; no headline or product prices are printed. Quoted terms such as "attack" and "institution" are typographically marked and may reflect original emphasis.

Languages
English
PDF page 9

Introduction • • • Get Ready! In November 1983 a small and unknown company in Scotts Valley, California, started shipping a new compiler for the relatively "old" and well-known Pascal programming language. The company called its product "Turbo Pascal." The first release was for microcomputers that used the CP/M operating system. This was followed shortly by a version for the operating systems used by the IBM PCs. In December 1986, shipments began for Version 1.0 of Turbo Pascal for the Macintosh. Of course, the "company" is Borland International. Still located in Scotts Valley, it is big by any measure. It is publicly traded, and markets its products worldwide. Pascal, the programming language, was originally created as a high-level language suited to teaching computer programming in school classrooms. Pascal may never have been intended for use in writing complete applications programs. If that was so, how- ever, many of us weren't aware of it and began to extend the use of Pascal outside the classroom and into applications and utilities of all sorts-simple and complex. During the past several years, a number of variations of what is generally referred to as the standard or generic Pascal have been created. Each of the variations may follow the general structure of the standard or generic Pascal; however, each invariably incorporates significant modifications in syntax. Perhaps in search of individuality, each adds to or subtracts from its library of predefined procedures and functions, which usually prevents a compiler from completely processing an "alien" construction. The predefinitions will be recognized only by the applicable compiler, which may be equally nonstandard or nongeneric. One can understand, if not appreciate, the confusion, dis- cussions, and conflicts that are caused by personal preferences or dislikes for specific compilers. viii

Printed product names
Turbo Pascal
Printed dates
November 1983 · December 1986
Languages
English
PDF page 10

With rare exceptions, Pascal compilers had or have common failings (which may have contributed to the Pascal's virtual disappearance from the programming scene and replacement by other programming languages). They are slow in doing their jobs of converting the Pascal source code to executable code. Their error-trapping methods have been considered inadequate, and error messages may be baffling, ambiguous, or vague. But, slow as it may be, the compiling process is a necessity. To a creative and busy programmer eager to see the compiler process his source code and make it executable, the waiting period is boring, irritating, time-consuming, and frustrating. Thus, when Borland's Turbo Pascal compiler Version 1.0 for the IBM PC arrived on the scene on November 15, 1983, many who had been working with other Pascal compilers eagerly risked the relatively small purchase price of $49.95 to sample and test the hard-to-believe claims for speed made for Turbo Pascal. To say the least, the product was startling! Minutes of compiling time were reduced to seconds. The self-contained editor, error-trapping, and error messages were uniquely helpful. They dramatically conserved the programmer's time and temper. Locating errors in source code and editing were so wonderfully facilitated by Borland Interna- tional's Turbo Pascal, that the very word "Turbo" has become part of the programmer's and marketer's jargon, equated with speed, simplicity, and reliability. Turbo Pascal Version 1.0 was soon updated to Version 2.0 . At the same time, Turbo-87 with support for the 8087 math coprocessor was introduced. Users marveled at Turbo Pascal's interactive editor, powerful library of built-in functions, and ease of operation. In 1985, Borland began shipments of Turbo Pascal Version 3.0, which compiled twice as fast as Version 2.0. Also in 1985, Borland introduced TurboBCD, with special numeric and string field-formatting features for business applications. Thus, in less than two years after the release of Version 1.0, there were three varieties of Borland's Turbo Pascal compilers. At first, the mistrusting ones among us may have thought of Borland's Turbo Pascal as a tinkerer's toy, a cheap way to hack at or play around with Pascal. However, Turbo Pascal has earned a rightful place among the important, indispensable tools for the development of serious applications programs. All the previously mentioned versions were specifically for use with CP/M systems, and with the series of IBM PC and compatible microcomputers. The rest is history- an enviable model for an entrepreneurial success story. Borland J nternational's reputation, physical size, and dollar volume have gone well beyond the original expectations of Philippe Kahn, its founder. Borland's product pricing and value have irrevocably changed marketing practices among software developers. There're more chapters to this never-ending success story. In November 1986, Borland introduced its Turbo Pascal software for the Macintosh computer, which gave birth to this book-a companion volume to Turbo Pascal Programming with Business Applications, TAB BOOKS, 1986, which is primarily for users of IBM PC and com- patibles. Borland is writing new history by bringing the power and facility of the Turbo Pascal-a combination of a programming language and a compiler-to the Macintosh family of microcomputers. This book intends to provide some "ready-made" and some not completely ready- made Turbo Pascal code specifically for the Macintosh. You can, at your leisure, ix

Reading notes: Source text contains spacing artifacts around product names and version numbers (e.g., 'Turbo Pascal Version 1.0') and an OCR-style error 'Borland J nternational' that may be a damaged character. Source does not contain a primary printed heading, so headline is null. Source text ends mid-sentence, so the reading order at the end may be incomplete.

Printed product names
Turbo Pascal · Turbo-87 · TurboBCD · Turbo Pascal Programming with Business Applications
Printed prices
$49.95
Printed dates
November 15, 1983 · 1985 · 1986 · November 1986
Languages
English
PDF page 11

customize and enjoy the code. At the same time, the heavily commented code provides you with a tutorial-a learning vehicle for some of the features that make Turbo Pascal exciting to work with. This book is not designed to take you from "zero to 60" as a Pascal programmer. No one book seems able to do that; however, it should provide a good starting point for new users, and additional knowledge for users who may already have some experience with Pascal, or even with Turbo Pascal. You have to personally experience the phenomenon of Borland's Turbo Pascal: its power and speed are among the indescribable and satisfying things one encounters in working with a high-level programming language. With this introduction, I'd like to extend a cordial invitation to use and profit from this book to all Macintosh users, especially those who have already discovered the remarkable capabilities of Turbo Pascal and want more source code to work with- and to those who are still using other Pascal compilers (and, therefore, may still be waiting for their compilers to finish the requisite multiple number of passes). The opening chapters deal with the unique characteristics of the Pascal program- ming language, and the Turbo Pascal compiler, as implemented by Borland. They get you writing several fundamental programs that show you how to use the Macintosh version of the Turbo Pascal editor and compiler and how to run the programs. These chapters are filled with assorted examples of source code that can be keyed into your Macintosh computer, compiled in seconds, and then executed. Then this book provides you with a liberal number of chapters that are dedicated to specific programs. Each chapter describes its program's application, lists the commented source code and, where relevant, shows actual printouts generated by runs of the program made with a stand- ard Macintosh Plus and an Imagewriter II. Several appendices at the back of this book provide reference information concerning the Macintosh version of the Turbo Pascal language and syntax. I make two simple assumptions: you already know how to use the Macintosh, and, you know how to use the Turbo Pascal program's editor and compiler. With these as- sumptions, I can save your time by not repeating the operator-instructions in the documents that are supplied with the computer and the Turbo Pascal program. As far as Borland's Turbo Pascal goes, you won't believe your eyes the very first (and second, and third . .. ) time you process source code with the Turbo Pascal compiler. Also, you'll be amazed, if you have some doubts, at the speed at which your Macintosh can operate. I believe you are about to have a great learning experience and a very good time! x

Reading notes: Primary heading not identifiable in supplied copy Possible OCR spacing artifacts in product names such as 'Turbo Pascal'

Printed product names
Turbo Pascal · Macintosh Plus · Imagewriter II
Languages
English