Radio Shack CTR-118 Manuel d'utilisateur

Naviguer en ligne ou télécharger Manuel d'utilisateur pour Lecteurs de cassettes Radio Shack CTR-118. Radio Shack CTR-118 User`s manual Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 196
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs

Résumé du contenu

Page 2 - LIMITED WARRANTY

iiA. Connect the black plug into the EAR jack on the side of the CTR-80.This connection provides the output signal from the CTR-80 to theTRS-80 (for l

Page 3 - Fort Worth, Texas 76102

8-6PEEK(address)Returns the value stored at the specified byte address (in decimal form). Touse this function, you'll need to refer to two sectio

Page 4

8-7We can use POKE to turn on the entire PRINT position (6 bits) at one time.When we use SET, only 1 bit is turned on. Therefore POKE is about 6 times

Page 5 - CONTENTS

8-8USR (x)This function lets you call a machine-language subroutine and then continueexecution of your BASIC program."Machine language" is t

Page 6

8-9For example, if the entry point is at 32700:32700 decimal = 7FBC hexadecimalLSB = BC hexadecimal = 188 decimalMSB = 7F hexadecimal = 127 decimalSo

Page 7 - This Reference Manual and You

8-10Control will pass back to your program, and the integer in HL will replaceUSR(N). For example, if the call was X=USR(N) then X will be given theva

Page 8

8-11170 READ A180 POKE X,A190 NEXT X192 '194 ' ******* CLEAR SCREEN & PRINT NUMBERS 1 THRU 100 *******196 '200 CLS205 PRINT

Page 9 - Setting up the System

8-127D03 CB15 00250 RL L ;SHIFT L7D05 CB14 00260 RL H ;SHIFT H - ANSWER IN HL7D07 C39A0A 00270 JP PUTANS ;RETURN TO BASIC W/ANSWER00280 ;7D00 00290 EN

Page 10 - Notes on Using the Recorder

8-13VARPTR (variable name)Returns an address-value, which will help you locate where the variablename and its value are stored in memory. If the varia

Page 11 - Special Notes:

8-14The address will probably be in high RAM where string storage space hasbeen set aside. But, if your string variable is a constant (a string litera

Page 12

8-15ExamplesA! = 2 will be stored as follows2 = 10 Binary, normalized as .1 E2 = .1 x 22So exponent of A is 128+2 = 130 (called excess 128)MSB of A is

Page 13 - 1 / General Information

iii5. When you are not going to use a CTR-80 for loading or recordingprograms, do not leave RECORD or PLAY keys down (press STOP).6. REWIND and FAST-F

Page 14 - Operating Modes

8-16The operations are performed in bitwise fashion; this means that each bit ofthe result is obtained by examining the bit in the same position for e

Page 15 - Special Function Keys

8-17NOT 0 = -1 The bit complement of binary 0 to 16 places is six-teenones (1111111111111111) or-1. Also NOT -1=0.NOT X NOT X is equal to -(X+1). This

Page 17 - Arithmetic Operators

9-19 / EditingLEVEL I users undoubtedly spent lots of time retyping longprogram lines, all because of a typo, or maybe just to make aminor change. Onc

Page 18 - Relational Operators

9-2Now type EDIT 100 and hit [ENTER]. The Computer will display:100 _You are now in the Edit Mode and may begin editing line 100.NOTE: EDITing a progr

Page 19 - Order of Operations

9-3Now type 8 and hit the Space-bar. The cursor will move over 8 spaces to theright, and 8 more characters will be displayed.n ←←←←(Backspace)Moves th

Page 20 - Abbreviations

9-4L (List Line)When the Computer is in the Edit Mode, and is not currently executing one ofthe subcommands below, hitting L causes the remainder of t

Page 21 - Keyboard Rollover

9-5I (Insert)Allows you to insert material beginning at the current cursor position on theline. (Hitting ←←←← will actually delete material from the l

Page 22 - Glossary for LEVEL II BASIC

9-6Q (Cancel and Exit)Tells Computer to end editing and cancel all changes made in the currentediting session. If you've decided not to change th

Page 23 - 2 / Commands

9-7nC (Change)Tells the Computer to let you change the specified number of charactersbeginning at the current cursor position. If you type C without a

Page 25 - CLOAD? "

9-8nKc (Search and "Kill")Tells the Computer to delete ail characters up to the nth occurrence ofcharacter c, and move the cursor to that po

Page 26 - DELETE 11-18

10-110 / Expansion InterfaceAn Expansion Interface is available for the TRS-80 LEVEL IIComputer. This interface will allow the use of additionalInput/

Page 27

10-2This is a very simple application; however, very powerful routines can beconstructed to allow input and output of data using two tapessimultaneous

Page 28

10-3LLISTWorks like LIST, but outputs to the PrinterLLISTList current program to printer.LLIST 100-Will list line 100 to the end of the program to the

Page 29

10-4CodesSeveral codes are used to control the output of the line printer. You canLPRINT CHR$(n) where n is the TRS-80 Control Code from the chart bel

Page 30

10-5page, it figures the number of lines to leave blank and then it spaces downthis amount to start the next page.When the Computer is first powered u

Page 31 - 3 / Input-Output

10-6Mini-Disks - (DISK BASIC)The TRS-80 Mini Disk System is a small version of a floppy disk. The diskallows vast file storage space and much quicker

Page 32

10-7Expansion of RAM MemoryThe TRS-80 Expansion Interface has provisions for adding extra RAMmemory. This is done by adding RAM memory chips. You can

Page 34 - PRINT USING

11-111 / Saving Time and SpaceMost LEVEL II programs are faster and take up less memoryspace than their LEVEL I counterparts. But even with itsinheren

Page 35

1-11 / General InformationThis chapter will provide you with an overview of LEVEL IIBASIC - what some of its special features are, how it differsfrom

Page 36

11-2Speeding Up ExecutionThe speed at which a program is processed will depend on the complexity ofthe operations and the number of instructions. In m

Page 37

Appendix

Page 39

A-1A / Level II SummaryCommandMode Function

Page 40

A-2Type Declaration CharactersCharacter Type Examples

Page 41

A-3Order of Operations Page↑

Page 42 - INPUT #-1

A-4Command/Function Examples PageCSAVESave a BASIC program ontapeCSAVE "A"CSAVE #-2,"A"(with expansion interface)2/4DELETE mm-nnDe

Page 43 - 40 GOTO 10

A-5Edit Mode Subcommands and Function KeysSub-Command Function PageENTEREnd editing and return to Command Mode. 9/2SHIFT ↑↑↑↑Escape from X, I, and H s

Page 44

A-6Input/Output StatementsStatement/Function Examples PagePRINT exp*Output to Display the value ofexp. Exp may be a numeric orstring expression or con

Page 45 - 4 / Program Statements

A-7Statement/Function Examples PageDATA item listHold data for access by READstatementDATA 22,33,11,1.2345DATA "HALL ","SMITH ",&q

Page 46 - 10 DEFINT I-N

1-2RADIO SHACK LEVEL II BASICREADY>_will appear on the screen. You are now ready to use LEVEL II BASIC.ResetThe Reset button is on the back of the

Page 47 - 10 DEFDBL S-Z, A-E

A-8StringCharacter Function Example Page!Single character.!3/5%spaces%String with length equal to 2plus number of spaces between% symbols.% %3/5Progra

Page 48 - 10 CLEAR 1000

A-9Statement/Function Examples PageLET variable=expressionAssign value of expression tovariable. LET is optional inLEVEL II BASIC.LET A$="CHARLIE

Page 49

A-10Statement/Functions Examples PageNEXT variableClose FOR-NEXT loop. Variablemay be omitted. To close nestedloops, a variable list may beused. See C

Page 50

A-11Statement/Function Examples Page(Graphics Statements)CLSClear Video DisplayCLS8/2RESET(x,y)Turn off the graphics block withhorizontal coordinate x

Page 51

A-12String FunctionsFunction Operation Examples PageASC(string)Returns ASCII code of first characterin string argument.ASC(B$)ASC ("H")5/5CH

Page 52

A-13Arithmetic Functions*FunctionOperation (unless noted otherwise,-1.7E+38<= exp < =1.7E+38) Examples PageABS(exp)Returns absolute value.ABS(L*

Page 53

A-14Function Operation Examples PageSGN(exp)Returns -1 for negative exp; 0 for zeroexp; +1 for positive exp.SGN(A*B+3)SGN(COS(X))7/4SIN(exp)Returns th

Page 54

A-15Function Operation and Limits Examples PageUSR(n) Branches to machine language sub-routine. See Chapter 8.USR(0) 8/8-12VARPTR(var) Returns the add

Page 55

A-16LEVEL II Reserved Words*@ FIX PEEKABS FOR POINTAND FORMAT POKEASC FRE POSATN FREE POSNAUTO GET PRINTCDBL GOSUB PUTCHR$ GOTO RANDOMCINT IF READCLEA

Page 56

A-17Program Limits and Memory OverheadRANGESIntegers -32768 to +32767 inclusiveSingle Precision -1.701411E±38 to +1.701411E±38 inclusiveDouble Precisi

Page 57 - ON ERROR GOTO

1-3Special Function KeysLEVEL II BASIC offers the same special function keys as LEVEL I plus afew extras. The function of the key depends on what mode

Page 59

B-1B / Error CodesCODE ABBREVIATION ERROR1 NF NEXT without FOR2 SN Syntax error3 RG Return without GOSUB4ODOut of data5 FC Illegal function call6OVOve

Page 60

B-2Explanation of Error MessagesNF NEXT without FOR: NEXT is used without a matching FOR statement. This error may alsooccur if NEXT variable statemen

Page 61

B-3LS String Too Long: A string variable was assigned a string value which exceeded 255characters in length.ST String Formula Too Complex: A string op

Page 63 - Type Conversion

C-1C / TRS-80 Character CodesBit-Pattern CodesThe following table illustrates the bit pattern for each of the 128 TRS-80characters. The remaining 128

Page 64

C-2Decimal/Hexadecimal CodesDec.CodeHex.Code Char.Dec.CodeHex.Code Char.Dec.CodeHex.Code Char.0 00 NULL 32 20 SPACE 64 40 @1 01 BREAK 33 21 ! 65 41 A2

Page 65

C-3Control Codes: 0-31Dec. Code Hex Code Function0-7 00-07 None8 08 Backspace and erases current character909None10 0A Line feed with carriage return1

Page 66

C-4The following control characters may be entered directly from the Keyboard:Character Key Character KeyBREAK[BREAK]EM[SHIFT] [\À\]BKSP[\À\]SUB[SHIFT

Page 67 - 5 / Strings

C-5Space Compression Codes: 192 to 255Decimal HexCodes Codes Function 192-25

Page 68 - String Input/Output

1-4Variable NamesVariable names must begin with a letter (A-Z) and may be followed byanother letter or digit (0-9). So the following are all valid and

Page 70 - String Space

Graphic Characters

Page 72

D-1D / Memory MapDecimal Address Hex Address012287LEVEL II ROM000030001228815359RESERVED FOR MEMORY-MAPPEDI /O30013BFF1536016383VIDEO MEMORY3C003FFF16

Page 73

D-2Important AddressesDecimal Hexadecimal14302 37DECommunication Status Address14303 37DFCommunication Data Address14304 37E0Interrupt Latch Address14

Page 74 - (string, n)

E-1E / Internal Codes for BASIC KeywordsThe following are the internal codes that the Computer uses to store BASICkeywords. If you PEEK at the program

Page 75

E-2Dec.Code BASIC KeywordDec.Code BASIC Keyword205 + 231 CVS206 – 232 CVD207 * 233 EOF208 / 234 LOC209↑↑↑↑235 LOF210 AND 236 MKI$211 OR 237 MKS$212 &g

Page 76 - STRING$

F-1F / Derived FunctionsFunction Function Expressed in Terms of Level II Basic FunctionsSECANT SEC(X) = 1/COS(X)COSECANT CSC(X) = 1/SIN(X)COTANGENT CO

Page 78 - Instring Subroutine

G-1G / Base ConversionsThe following table lists base conversions for all one-byte values.DEC. BINARY HEX. OCT.0 00000000 00 0001 00000001 01 0012 000

Page 79

1-5The same variable name may be used for different variable types, and theComputer will still keep them distinct, because of the type declarationchar

Page 80

G-2DEC. BINARY HEX. OCT.82 01010010 52 12283 01010011 53 12384 01010100 54 12485 01010101 55 12586 01010110 56 12687 01010111 57 12788 01011000 58 130

Page 81 - 6 / Arrays

G-3DEC. BINARY HEX. OCT.176 10110000 B0 260177 10110001 B1 261178 10110010 B2 262179 10110011 B3 263180 10110100 B4 264181 10110101 B5 265182 10110110

Page 83

H-1H / User ProgramsSpecial Keyboard Input RoutineHere's a general-purpose keyboard input routine (lines 100-175) for use in anyprogram where the

Page 84 - Other Types of Arrays

H-2700 '800 ' *** MAIN PROGRAM ***900 '1000 PRINT: FL$="": INPUT"FIELD-LENGTH (FL) = ";FL$1005 IF FLT<>"

Page 85

H-3157 '160 INPUTA$: IF A$="END" THEN PRINT@576,CHR$(31);: END170 IF N<6 THEN N=N+1174 '175 ' IF BOTTOM OF SCREEN HAS 6 LI

Page 86

H-4230 IF A(L) < A(J) THEN TEMP = RtJ): A(J) = A(L): A(L) = TEMP: J = J-D: IF J>0 THEN 220240 NEXT I250 G

Page 87

H-5• Landing conditions are different for each planetary body because eachhas its own particular gravity: Earth = 980 cm/sect ; Moon = 162 cm/sect :M

Page 88

H-61040 IF V2<5000 PRINT "MADE A NEW CRATER" : GOTO 50001050 IF V2>4999 PRINT "BORED A HOLE INTO THE PLANET" : GOTO 50001100

Page 89 - 7 / Arithmetic Functions

H-7410 FOR I=1 TO P1 :IF N$=N$(I) GOTO430415 NEXT420 PRINT"NAME NOT IN FILE" :GOTO460430 PRINT"ENTER THE CORRECTED INFO.: NAME, ADDRESS

Page 90 - 100 PRINT CSNG(A#+B#)

1-6Relational OperatorsThese are the same as LEVEL I.< (less than) > (greater than) =(equal to)<> (not equal to) <=(less than or equal

Page 91 - 100 PRINT LOG(3.3*X)

H-8400 'ASA410 PRINT"ENTER 2 ANGLES AND 1 SIDE: THETA1, THETR2, AB:420 INPUT T1, T2, L2425 T1 = (T1 * 3.14159) / 180 : T2 = (T2 * 3.14159) /

Page 92

H-91 CLS:PRINT : PRINT CHR$(23) ; "HIT 'Z' KEY TO AIM LEFT."2 PRINT "HIT '/' KEY TO RIM RIGHT."3 PRINT "H

Page 93

H-10100 IF Y=47 THEN 120105 IF Y=0 GOSUB 900110 IF Y <> -1 OR X <> -1 THEN 60120 Y= Y- 2 * D : D= -D : GOTO 60500 IF X=Z OR X=Q+Z OR X=2 *

Page 94

I-1I / Converting LEVEL I ProgramsBecause of the differences between LEVEL I BASIC and LEVEL II BASIC,you will need to use the CONV program to transla

Page 95 - 8 / Special Features

I-2This statement would allow you to use array elements A(0) throughA(30). Of course, you can use any variable name as an array name inLEVEL II BASIC.

Page 96

J-1J / Important Information for Cassette UsersFree Modification for LEVEL II UnitsA modification that helps cassette loads in LEVEL II computers is a

Page 97

2Notice that volume ranges for LEVEL I and LEVEL II are different. This isbecause the LEVEL II data transfer rate is faster (500 baud vs. 250 baud).Al

Page 98 - ERR /2+1

J-3LEVEL ISometimes you will get an error message during an attempted CLOAD. Thismeans that some information was lost or garbled. Adjust the volume le

Page 101

1-7String OperatorsStrings may be compared and concatenated ("strung together") in LEVEL ll.A whole chapter of this Manual is devoted to str

Page 103 - JP 0A9AH

IndexSubject Page Subject Page1Abbreviations ...1/8ABS ...

Page 104

IndexSubject Page Subject Page2File Name ...2/2-2/4FIX ...

Page 105

IndexSubject Page Subject Page3POINT...8/2POKE ...

Page 108

RADIO SHACK A DIVISION OF TANDY CORPORATIONU.S.A.: FORT WORTH, TEXAS 76102CANADA: BARRIE, ONTARIO L4M 4W5TANDY CORPORATIONAUSTRALIA BELGIUM U.K.280-3

Page 109 - Logical Operators

©Copyright 1978, by Radio Shack, A Division of Tandy Corporation, Ft. Worth, Texas 76102LIMITED WARRANTYRadio Shack warrants for a period of 90 days f

Page 110

1-8Intrinsic FunctionsMost of the subroutines in the LEVEL I manual are built-in to LEVEL II.They are faster, more accurate (to seven digits generally

Page 111 - 20 GOTO 10

1-9Keyboard RolloverWith the LEVEL I TRS-80 (and many other computers) you have to releaseone key before the Computer will allow entry of another key.

Page 112

1-10Glossary for LEVEL II BASICaddress a value specifying the location of a byte in memory; decimal valuesare used in LEVEL IIalphanumerics the set of

Page 113 - 9 / Editing

2-12 / CommandsWhenever a prompt > is displayed, your Computer is in the Command Mode.You can type in a command, [ENTER] it, and the Computer will

Page 114 - Space-bar

2-2CLEAR nWhen used without an argument (e.g., type CLEAR and hit [ENTER]), thiscommand resets all numeric variables to zero, and all string variables

Page 115 - 100 FOR I=_

2-3CLOAD? "file name"Lets you compare a program stored on cassette with one presently in theComputer. This is useful when you have dumped a

Page 116 - X (Extend Line)

2-4CSAVE "file name"Stores the resident program on cassette tape. (Cassette recorder must beproperly connected, cassette loaded, and in the

Page 117 - E (Save Changes and Exit)

2-5EDIT line numberPuts the Computer in the Edit Mode so you can modify your residentprogram. The longer and more complex your programs are, the morei

Page 118 - D (Delete)

2-6RUN line numberCauses Computer to execute the program stored in memory. If no linenumber is specified, execution begins with lowest numbered progra

Page 119 - 100 FOR I=1 TO 1_

2-7TROFFTurns off the Trace function. See TRON.TRONTurns on a Trace function that lets you follow program-flow for debuggingand execution analysis. Ea

Page 120

A DIVISION OF TANDY CORPORATIONOne Tandy CenterFort Worth, Texas 76102

Page 122 - Line Printer

3-13 / Input-OutputThe statements described in this chapter let yousend data from Keyboard to Computer, Computerto Display, and back and forth between

Page 123

3-2--------------------------------------------------30 X=2540 PRINT 25 "IS EQUAL TO" XRUN 25 IS EQUAL TO 25--------------------------------

Page 124 - LINE THREE

3-3PRINT @ position, item listSpecifies exactly where printing is to begin. (AT was used in LEVEL IBASIC.) The @ modifier must follow PRINT immediatel

Page 125 - POKE 16425,0

3-4PRINT USING string; item listPRINT USING – This statement allows you to specify a format for printingstring and numeric values. It can be used in m

Page 126 - Additions to LEVEL II

3-5+ When a + sign is placed at the beginning or end of the field, itwill be printed as specified as a + for positive numbers or as a -for negative nu

Page 127 - Expansion of RAM Memory

3-6? +##.##,12.12+12.12? "THE ANSWER IS "+##.##,-12.12THE ANSWER IS -12.12? ##,##+,12.1212.12+? "THE ANSWER IS ##.##+.",-12.12THE

Page 128

3-7Multiple strings or string variables can be joined together (concatenated) bythese specifiers. The "!" sign will allow only the first let

Page 129 - 11 / Saving Time and Space

3-8WHAT IS YOUR LAST NAME? JONESENTER AMOUNT PAYABLE? 12345.6PAY TO THE ORDER OF J. P. JONES*******$12,345.60 DOLLARSIf you want to use an amount grea

Page 130 - Speeding Up Execution

3-9Be sure to enter the correct type of value according to what is called for bythe INPUT statement. For example, you can't input a string-value

Page 131 - Appendix

Second Edition - 1979Second Printing - 1979All rights reserved. Reproduction or use, withoutexpress permission, of editorial or pictorialcontent, in a

Page 132

3-10Example:100 INPUT "ENTER YOUR NAME AND AGE (NAME,AGE)";N$,A(RUN)ENTER YOUR NAME AND AGE (NAME,AGE)?_DATA item listLets you store data in

Page 133 - A / Level II Summary

3-1150 PRINT "NAME","AGE"100 READ N$110 IF N$="END" PRINT "END OF LIST":END120 READ AGE130 IF AGE < 18 PRI

Page 134

3-12PRINT #-1, item listPrints the values of the specified variables onto cassette tape. (Recorder mustbe properly connected and set in Record mode wh

Page 135 - Commands

3-13When this statement is executed, the Computer will turn on the tapemachine, input values in the order specified, then turn off the tape machineand

Page 137

4-14 / Program StatementsLEVEL II BASIC makes several assumptions abouthow to run your programs. For example:* Variables are assumed to be single-prec

Page 138 - Input/Output Statements

4-2DEFINT letter rangeVariables beginning with any letter in the specified range will be stored andtreated as integers, unless a type declaration char

Page 139

4-3DEFSNG letter rangeCauses any variable beginning with a letter in the specified range to bestored and treated as single precision, unless a type de

Page 140 - Program Statements

4-4DEFSTR letter rangeCauses variables beginning with one of the letters in the specified range to bestored and treated as strings, unless a type decl

Page 141

4-5Example:10 DIM A(5),B(2,3),C$(20)Sets up a one-dimension array A with subscripted elements 0-5; atwo-dimension array B with subscripted elements 0

Page 142

CONTENTSSetting up the System... i-iii1 / General Infor

Page 143

4-6ENDTerminates execution normally (without a BREAK message). Some versionsof BASIC require END as the last statement in a program; with LEVEL 11 iti

Page 144 - String Functions

4-7GOTO line numberTransfers program control to the specified line number. Used alone, GOTOline number results in an unconditional (or automatic) bran

Page 145 - Arithmetic Functions*

4-8Control branches from line 100 to the subroutine beginning at line 200. Line210 instructs Computer to return to the statement immediately following

Page 146 - Special Functions

4-9Sample Program Using ON n GOTO100 INPUT "ENTER A NUMBER";X200 ON SGN(X)+2 GOTO 220,230,240220 PRINT "NEGATIVE":END230 PRINT &qu

Page 147

4-10FOR counter = exp TO exp STEP exp NEXT counterOpens an iterative (repetitive) loop so that a sequence of program statementsmay be executed over an

Page 148 - LEVEL II Reserved Words*

4-1110 FOR K=0 TO 1 STEP.320 PRINT K;30 NEXTRUN 0.3.6.9READY>_After K=.9 is incremented by .3, K=1.2. This is greater than the final value 1,the

Page 149

4-12FOR-NEXT loops may be "nested":10 FOR I=1TO320 PRINT"OUTER LOOP"30 FOR J=1 TO 240 PRINT" INNER LOOP"50 N

Page 150

4-13ERROR codeLets you "simulate" a specified error during program execution. The majoruse of this statement is for testing an ON ERROR GOTO

Page 151 - B / Error Codes

4-14The ON ERROR GOTO statement can be disabled by executing an ONERROR GOTO 0. If you use this inside an error-trapping routine, BASIC willhandle the

Page 152 - Explanation of Error Messages

4-15REMInstructs the Computer to ignore the rest of the program line. This allows youto insert comments (REMarks) into your program for documentation.

Page 154

4-16100 IF 0<=X AND X<=90 THEN Y=X+180If both expressions are True then Y will be assigned the value X+180.Otherwise, control will pass directly

Page 155 - C / TRS-80 Character Codes

4-17ELSE statement or line numberUsed after IF to specify an alternative action in case the IF test fails. (Whenno ELSE statement is used, control fal

Page 156 - Decimal/Hexadecimal Codes

4-18Data ConversionEvery number used during execution must be typed as either integer, singleprecision or double precision. Often this typing involves

Page 157 - Control Codes: 0-31

4-19Type ConversionWhen operations are performed on one or two numbers, the result must betyped as integer, double or single-precision.When a +, -, or

Page 158 - Graphics Codes: 128-191

4-20Effects of Type Conversions on AccuracyWhen a number is converted to integer type, it is "rounded down"; i.e., thelargest integer, which

Page 159

4-21.6666666865348816READY>_2/3 is converted to a single precision constant; therefore only the first sevendigits of A# are accurate.--------------

Page 160

4-22Assigning Double-Precision ValuesHere are three ways to be sure double-precision values are stored withoutany trailing "garbage digits".

Page 161 - Graphic Characters

5-15 / Strings"Without string-handling capabilities, a computer is just asuper-powered calculator." There's an element of truth in that

Page 162

5-2String Input/OutputString constants -sequences of alphanumeric characters - may be input to aprogram just as numeric constants are input, using INP

Page 163 - D / Memory Map

5-3String ComparisonsStrings may be compared for equality or alphabetic precedence. When theyare checked for equality, every character, including any

Page 164 - Important Addresses

This Reference Manual and YouWe've prepared this Reference Manual with the assumption that you - theuser - already have considerable experience w

Page 165

5-4String OperationsNot including the functions described below, there is only one stringoperation - concatenation, represented by the plus symbol +.E

Page 166

5-5ASC (string)Returns the ASCII code (in decimal form) for the first character of thespecified string. The string-argument must be enclosed in parent

Page 167 - F / Derived Functions

5-6CHR$ may also be used to display any of the 64 graphics characters.(See Appendix C, Graphics Codes.)10 CLS20 FOR I=129 TO 19130 PRINT I;CHR$(I),

Page 168

5-7INKEY$Returns a one-character string determined by an instantaneous keyboardstrobe. The last key pressed before the strobe is returned. If no key i

Page 169 - G / Base Conversions

5-8LEFT$ (string, n)Returns the first n characters of string. The arguments must be enclosed inparentheses. string may be a string constant or express

Page 170

5-9MID$ (string, p, n)Returns a substring of string with length n and starting at position p. Thestring name, length and starting position must be enc

Page 171

5-10Example Program10 A=58.5: B=-58.520 PRINT STR$(A)30 PRINT STR$(B)40 PRINT STR$(A+B)50 PRINT STR$(A)+STR$(B)RUN 58.5-58.5 0 58.5-58.5READY>

Page 172

5-11VAL (string)Performs the inverse of the STR$ function: returns the number representedby the characters in a string argument. The numerical type of

Page 173 - H / User Programs

5-12Coding/Decoding Program5 CLS: PRINT CHR$(23)10 CLEAR 100020 INPUT "ENTER MESSAGE"; M$30 FOR K=1 TO LEN(M$)40 T$=MID$(M$, K, 1 )60

Page 174

5-13Here's a sample program using the INSTRING subroutine. (Type in theabove lines 999-1020 plus the following.)5 CLEAR 1000 : CLS10 INPUT &qu

Page 177

6-16 / ArraysAn array is simply an ordered list of values. In LEVEL IIthese values may be either numbers or strings, depending onhow the array is defi

Page 178 - Customer Information

6-2Let's set up an array, CK, to correspond to the checkbook information table.Since the table contains 6 rows and 3 columns, array CK will need

Page 179

6-3Now that our array is set up, we can begin taking advantage of its built-instructure. For example, suppose we want to add up all the checks written

Page 180 - Target Practice

6-4Other Types of ArraysRemember, in LEVEL II the number of dimensions an array can have (andthe size or depth of the array), is limited only by the a

Page 181

6-5To use this subroutine, your main program must supply values for threevariables N1 (size of dim#1), N2 (size of dim#2) and N3 (size of dim#3).Withi

Page 182

6-6Main program supplies values for variables N1 , N2, N3. Within thesubroutine, you can assign values to each element of the array using theINPUT sta

Page 183

6-7Matrix Addition (3 Dimensional)30800 FOR K=1 TO N330810 FOR J = 1 TO N230820 FOR I=1 TO N130830 C(I,J,K)=A(I,J,K)+B(I,J,K)30840 NEXT

Page 185 - Using Your Cassette Deck

7-17 / Arithmetic FunctionsLEVEL II BASIC offers a wide variety of intrinsic ("built-in")functions for performing arithmetic and special ope

Page 186

iSetting up the SystemCarefully unpack the system. Remove all packing material. Be sure youlocate all cables, papers, tapes, etc. Save the packing mat

Page 187 - Hints and Tips

7-2CDBL (x)Returns a double-precision representation of the argument. The valuereturned will contain 17 digits, but only the digits contained in the a

Page 188

7-3EXP (x)Returns the "natural exponential" of X, that is, ex. This is the inverse of theLOG function, so X=EXP(LOG(X)).100 PRINT EXP(-X)FIX

Page 189

7-4RANDOMRANDOM is actually a complete statement rather than a function. It reseedsthe random number generator. If a program uses the RND function, yo

Page 190

7-5SQR(x)Returns the square root of the argument. SQR(X) is the same as X↑(1/2), onlyfaster.100 Y=SQR(X↑↑↑↑2-H↑↑↑↑2)TAN(x)Returns the tangent of the a

Page 192

8-18 / Special FeaturesLEVEL II BASIC offers some unusual functions andoperations that deserve special highlighting. Some may seemhighly specialized;

Page 193

8-2Examples:100 SET(RND(128)-1,RND(48)-1)Lights up a random point on the Display.100 INPUT X,Y: SET(X,Y)RUN to see where the blocks are.RESET(x,y)Turn

Page 194

8-3ERLReturns the line number in which an error has occurred. This function isprimarily used inside an error-handling routine accessed by an ON ERRORG

Page 195

8-4ERR /2+1Similar to ERL, except ERR returns a value related to the code of the errorrather than the line in which the error occurred. Commonly used

Page 196

8-5MEMReturns the number of unused and unprotected bytes in memory. Thisfunction may be used in the Command Mode to see how much space aresident progr

Commentaires sur ces manuels

Pas de commentaire