About Basic for Ms-Dos
Total Page:16
File Type:pdf, Size:1020Kb
TERNS A\C rO\D T O\S OF SA-! A+D .CEZSE OF TAhDV COMP-TER EO, PNEhT A40 SOF-;\AQF J.RCnASE3 F33V 7AC 0 SnACI( :3VPA\'-OhhED COVP-TER CEhTERS RETA j-?RE? A\? >A0 S SrAC< F9A\Cn SEES 'IR 2EA-E;IS AT TnE R A-TnOR ZEC -0CAT OhS LIMITED WARRANTY CUSTOMER OBLIGATIONS A CUSTOMER assumes full responsibility that this computer hardware purchased (the Equipment and any copies of software included with the Equipment or licensed se arately (the Software ) meets the specifications capacity capabilities versatility and other requirements of CUETOMER 6 CUSTOMER assumes full responsibility lor the condAon and effectiveness of the operating environment in whlch toe Equipment and Software are to function and lor its installation LIMITED WARRANTIES AND CONDITIONS OF SALE A For a period of ninety (901 calendar days lrom the date of the Radio Shack sales document received upon purchase of the Equipment RADIO SHACK warrants to the original CUSTOMER that the Equipment and the medium upon which the Software is stored is free from manufacturing defects This warranty is only applicable lo purchases of Tandy Equipment by the original customer from Radlo Shack company-owned computer cenlers retail stores, and Radlo Shack franchisees and dealers at their aulhorlzed locations The warrantv is 111. 6 9ADIO SPACK sha I not be liable for any damages caused by delay in delivering or furnishing Equipment and or Softviare C No actio1 ar sin out of any claimed breach of this Warranty or transactions under this Warranty may be brought rr'ore than two 92) years after the cause of action has accrued or more than four (4) years after the date of the Radio Shack sales document for the Equlpment or Software whichever first occurs D Sore states do not a1 ow the imitat on or exclusion of incidental or coiseouential damages so the above imitationis) or exclusionls) may lot apply to CUSTOMER IV. SOFTWARE LICENSE RADIO SHACK grants to CUSTOMER a non exclusive paid up license to use the TANDY Software on one computer subject to the following provisions A Except as otherwise provided in this Software License applicable copyright laws shall apply to the Software B Title to the medium on Nhich the Software is recorded (cassette and or diskette) or stored IROMi is transferred to CLSTOMER but not t'tle to the Software C CLSTOMER may use Software on a multiuser or network system only if eit'ler the Software is expressly labeled to be for use on a multiuser or network system or one copy of th s software is purchased for each node or terwiial on wh ch Software s to be used simultaneously D CUSTOMER shal, not use make manufacture or reproduce copies of Software except for use on one computer and as is specifically provided in this Software License Customer is expressly prohibited from disassembling the Software E CUSTOKER s perwitted to make additional copies of the Software only for backup or archival purposes or If additional copies are required in the operation of one computer with the Software but only to the extent the Software allows a backup copy to be made However for TRSDOS Software CUSTOMER is permitted to make a lim ted number of additionas copies for CUSTOMER S own use F CLSTOMER may resell or distribute unmodified copies of the Software provided CUSTOMER has purchased one copy of the Software for each one soid or distributed The provisions of this Software License shall also be applicable to third parties receving copies of the Software from CUSTOMER C All copyright notices s+al' be retained on all copies of the Software V. APPLICABILITY OF WARRANTY A T9e term and conditions of this Warranty are applicable as between RADIO SHACK and CLSTOMER to either a sale of the Equipment and or Software License to CUSTOMER or to a transaction whereby Radio Slack sells or conveys such Equipment to a third party lor lease to CUSTOMER 6 The imitations of liabil ty and Warraity provisions herein sha I nure to the benefit of RADIO SHACK the author owner and or licensor of the Software and any manufacturer of the Equipment sold by Radio Shack VI. STATE LAW RIGHTS The warranties granted herein give the original CUSTOMER specific legal rlghts and 1% original CUSTOMER may have other riglts which vary from state to state 8 85 GW '"-BASIC Software: Copyright 1983, 1984 Microsoft Corpora- tion. Licensed to Tandy Corporation. All Rights Reserved. MS"'-DOS Software: Copyright 1981, 1982, 1983 Microsoft Cor- poration. Licensed to Tandy Corporation. All Rights Reserved. Tandym 1000 BIOS Software: Copyright 1984 Tandy Corporation and Phoenix Compatibility Corporation. All Rights Reserved. BASIC Reference Manual: Copyright 1985 Tandy Corporation. All Rights Reserved. MS and GW are trademarks of Microsoft Corporation. Tandy is a registered trademark of Tandy Corporation. Reproduction or use without express written permission from Tandy Corporation, of any portion of this manual is prohibited. While reasonable efforts have been taken in the preparation of this manual to assure its accuracy, Tandy Corporation assumes no liability resulting from any errors in or omissions from this manual, or from the use of the information contained herein. 10 9 8 7 6 5 4 3 2 Contents Introduction to BASIC 7 About this Manual 7 Notations 7 Terms 8 Chapter 1 / About BASIC for MS-DOS 11 Disk Files 11 Pathnames 12 Directory Paths 12 Names 13 Wildcards 13 Device Names 14 Chapter 2 / Loading MS-DOS and BASIC 17 Loading MS-DOS 17 Making Backups 17 One Drive System 18 Two Drive System 18 LoadingBASIC 19 Loading BASIC via BASICA 19 Options for Loading BASIC 20 Redirection of Input and Output 23 Chapter 3 / Sample Session 27 Loading BASIC 27 Typing the Program 27 Saving the Program on Disk 28 Loading the Program into Memory 28 Chapter 4 / General Information 33 Editing 33 Sample Editing Session 34 SpecialKeys 36 The Key 38 The Key 39 3 Chapter 5 / Basic Concepts 43 Elements of a Program 43 Data 44 Constants 46 Variables 47 Declaring Numeric Constants and Variables 47 Numeric Constants 48 Numeric Variables 48 Numeric Precision Conversion 49 Manipulating Data 51 Arithmetic Operators 51 String Operator 52 Relational Operators 52 Logical Operators 54 Hierarchy of Operators 55 Functions 56 Chapter 6 / Arrays 59 Types of Arrays 62 Defining Arrays 63 Chapter 7 / Disk Files 67 Sequential Access Files 67 Creating a Sequential Access File 68 Updating a Sequential Access File 69 Direct Access Files 70 Creating a Direct Access File 71 Accessing a Direct Access File 73 Chapter 8 / Displaying Color and Graphics 77 Resolution 77 78 VideoPages 79 Selecting Screen Modes 80 Specifying Coordinates 82 Chapter 9 / Introduction to BASIC Keywords 85 Format for Chapter 10 85 Terms Used in Chapter 10 86 Statements 87 Functions 92 Chapter 10 / BASIC Keywords 97 4 Chapter 11 / Technical Information 351 Interfacing With Assembly-Language Routines 351 Memory Allocation Outside BASIC’s Work Area 351 Memory Allocation Inside BASIC’s Work Area 351 CALL Statement 353 CALLS Statement 355 USR Function 355 How Variables are Stored 357 Accessing String Variables 358 File Control Block 358 User Installed Devices 361 Information for Creating Child Processes 361 Chapter 12 / BASIC Error Codes and Messages 365 Appendix A / BASIC Reserved Words and Derived Functions 375 Appendix B / Keyboard and Character Code Charts 379 Keyboard ASCII/Scan Codes 379 ASCII Character Codes 383 Appendix C I Video Display Worksheet 389 Appendix D / Extended Codes 391 Index 393 5 INTRODUCTION TO BASIC About This Manual This manual describes BASIC for MS-DOS. It is a reference manual, not a tutorial. We assume you already know BASIC and are using this manual to locate information quickly. If you do not know BASIC, see your Radio Shack dealer for the following book: Learning BASZC for the Tandy 200011 000 by David Lien, Cat. No. 25-1500 Your local bookstore has many books about BASIC available that are written in tutorial fashion. Notations The following notations are used throughout this manual: CAPITALS Material that you must enter exactly as it appears. italics Words, letters, characters, or values within command lines you must supply from a set of acceptable entries. Elsewhere, italics are used for emphasis. (ellipsis) Items preceding the ellipsis may be repeated. [I Items enclosed in brackets are optional. &Hnnnn nnnn is a hexadecimal number. &Onnnnn nnnnn is an octal number. [keynameJ A key on your keyboard. 16 A blank character (ASCII code 32). For exam- ple, in BASICMMPROG two spaces are between BASIC and PROG. 7 Introduction to BASIC Terms The following terms are used in this manual: buffer An area in memory that BASIC uses to create and access a disk file. A buffer is represented by a number in the range 1 to 15. Once you use a buffer to create a file, you cannot use it to create or access any other files; you must first close the file. You may only access an open file with the buffer used to open it. parameters Information you supply to specify how a com- mand is to operate. arguments Expressions you supply for a function to evaluate. syntax A command with its parameterb), or a func- tion with its argument(s). This shows the for- mat to use for entering a keyword in a program line. 8 Chapter 1 ABOUT BASIC FOR MS-DOS BASIC for MS”’-DOS is an interpreter. This means that, when you run a program, BASIC looks at one statement at a time and executes it before going to the next statement. BASIC also lets you take advantage of many MS-DOS features, such as: 0 Multilevel directories Faster running programs 0 Expanded graphics capabilities Disk Files BASIC uses the MS-DOS multilevel directory structure on disk.