Radio Shack® |
| The biggest name in little computersTM |
| © Copyright 1982 by Radio Shack, A Division of Tandy Corporation |
| $ | Makes variable string type. | |
| : | Separates statements on the same line. | |
| , | (comma) PRINT punctuation: spaces over to the next 16-column PRINT zone. | |
| ; | PRINT punctuation: separates items in a PRINT list but does not add spaces when they are output. |
|   |
| ^ | Exponentiation |
| -, + | Unary negative, positive |
| *, / | Multiplication, division |
| +, - | Addition and concatenation, subtraction |
| <, >, =, <=, >=, <> NOT AND OR | Relational tests |
|   |
| x: | (-1x10E38, -1x10E-38), (1x10E-38, 1x10E38) |
| c: | (0, 255) |
| n: | (-32768, 32767) |
| str: | string argument |
| var: | variable name |
| ABS(x) | Computes absolute value. Y = ABS(X) |
| ASC(str) | Returns ASCII code of first character of string. A = ASC(T$) |
| CHR$(c) | Returns character for ASCII, control, orgraphics code. P$ = CHR$(T) |
| COS(numeric) | Returns cosine of an angle given in radians. Y = COS(7) |
| EXP(numeric) | Returns natural exponential of number (Enumber). Y = EXP(7) |
| INKEY$ | Gets keyboard character if available. A$ = INKEY$ |
| INT(x) | Returns largest whole number not greater than x. Y = INT(X) |
| LEFT$(str,c) | Returns the left portion of the string. P$ = LEFT$(M$,7) |
| LEN(str) | Returns the number of characters in a string. X = LEN(S$) |
| LOG(numeric) | Returns natural logarithm. Y = LOG(353) |
| MEM | Finds amount of free memory. PRINT MEM |
| MID$(string,pos,len) | Returns a substring of another string. If length option is omitted, the entire string right of pos is returned. PRINT MID$(A$,3,2) F$=MID$(A$,3) |
| PEEK(n) | Gets value in location n (n = 0 to end of memory). V = PEEK(18520) |
| POINT(x,y) | Tests whether the specified graphics cell is on or off, IF POINT(13,25) THEN PRINT "ON" |
| RIGHT$(str,c) | Returns right portion of string. Z$ = RIGHT$(AD$, 5) |
| RND(n) | Generates a "random" number between 1 and n inclusive if n>1, or between 0 and 1 if n = 0. Y = RND(100) PRINT RND(0) R = RND(X) |
| SGN(x) | Returns sign component: -1, 0, 1, if x is negative, zero, positive. X = SGN(A*B) |
| SIN(x) | Computes sine; angle must be in radians. Y = SIN(X) |
| STR$(x) | Converts a numeric expression to a string. S$ = STR$(X) |
| SQR(numeric) | Returns the square root of a number. Y = SQR(5+3) |
| TAN(numeric) | Returns tangent of angle given in radians. Y = TAN(45.7) |
| VAL(str) | Evaluates a string as a number. V = VAL("100 DOLLARS") |
|   |
| [CONTROL][A] | Cancels last character typed; moves cursor back one space. |
| [CONTROL][Q] | Erases the current line. |
| [BREAK] | Interrupts anything in progress and returns to command level. |
| [ENTER] | Signifies end of current line. |
| [SPACEBAR] | Enters a space (blank) character and moves cursor one space forward. |
| [SHIFT][@] | Causes currently executing program to pause (press any key to continue). |
| [SHIFT][0] | (Shift Zero) Causes letters to be printed reversed (on the display) or lowercase (on the line printer). |
|   |
TRS-80® MICRO COLOR BASIC |
|   |
| CLEARn | Reserves n bytes of string storage space (0-3142). Initializes all variables. CLEAR CLEAR 75 CLEAR0 | ||||||||||||||||||
| CLOAD | Loads a BASIC program file from cassette. Only the first 8 characters of the file name are used. CLOAD CLOAD "MIXIT" | ||||||||||||||||||
| CLOAD* | Loads numeric data into an array from a cassette file which has been created using CSAVE*. Array name must be specified. CLOAD* G,"TOMFILE" | ||||||||||||||||||
| CLS(c) | Clears the display to the color (c) specified. If c is omitted, green is used. Colors:
| ||||||||||||||||||
| CONT | Continues execution of program after [BREAK] or STOP. CONT | ||||||||||||||||||
| CSAVE | Stores resident program on cassette tape. Only the first 8 characters of the file name are used. CSAVE CSAVE"MIXIT" | ||||||||||||||||||
| CSAVE* | Saves the contents of a numeric array on cassette tape for later use by CLOAD*. Array name must be specified. CSAVE* G,"ASHER" | ||||||||||||||||||
| DATA | Stores data to be accessed by a READ statement. DATA "LINCOLN, A", 1861, ILLINOIS | ||||||||||||||||||
| DIM | Dimensions one or more arrays. DIM R(65), W(40) DIM AR$(8,25) DIM L(3,18,5) | ||||||||||||||||||
| END | Ends program execution. | ||||||||||||||||||
| FOR...TO... STEP/NEXT | Opens program loop. FOR I=1 TO 8 (...) NEXT I FOR C=0 TO 5 STEP 2 (...) NEXT C | ||||||||||||||||||
| GOSUB | Transfers program control to the specified subroutine. GOSUB 750 | ||||||||||||||||||
| GOTO | Transfers program control to the specified line. GOTO 180 | ||||||||||||||||||
| IF...THEN | Tests conditional expression. IF P=0 THEN 200 IF N<>3 THEN GOSUB 500 | ||||||||||||||||||
| INPUT | Inputs data from the keyboard. INPUT X INPUT L,M,N INPUT "NEXT";N | ||||||||||||||||||
| LIST | Lists program lines to the video display. LIST LIST 50-85 | ||||||||||||||||||
| LLIST | Lists program lines to the line printer. LLIST LLIST 50- | ||||||||||||||||||
| LPRINT | Prints an item or list of items on the printer. LPRINT "TEST1" | ||||||||||||||||||
| NEW | Erases program from memory, intializes all variables. NEW | ||||||||||||||||||
| ON...GOSUB | Multi-way branch to specified subroutines. ON Y GOSUB 50, 100, 150, 200 | ||||||||||||||||||
| ON...GOTO | Multi-way branch to specified lines. ON X GOTO 190, 200, 210 | ||||||||||||||||||
| Prints an item or list of items on the display at current cursor position. PRINT X+Y PRINT "U.S.A" | |||||||||||||||||||
| PRINT@n | Prints beginning at n, n = 0 - 511. PRINT@238, "Center" | ||||||||||||||||||
| PRINT TAB | Moves the cursor to specified column position. PRINT TAB(5) "NAME" | ||||||||||||||||||
| READ | Reads value(s) from a DATA statement. READ T READ S$ READ NM$, AGE | ||||||||||||||||||
| REM | Remark; instructs computer to ignore rest of line. REM PLACE COMMENTS HERE | ||||||||||||||||||
| RESET(x,y) | Turns off graphics block at specified location. x (horizontal) = 0-63. y (vertical) = 0-31 RESET(21,30) RESET(L1,L2) | ||||||||||||||||||
| RESTORE | Resets data pointer to first item in the first data line. RESTORE | ||||||||||||||||||
| RETURN | Returns from subroutine to next statement after GOSUB. RETURN | ||||||||||||||||||
| RUN | Executes resident program or portion of it. RUN RUN 150 | ||||||||||||||||||
| SET(x,y,c) | Turns on graphics cell to specified color (c) at specified location x (horizontal) = 0-63; y (vertical) = 0-31. See CLS for colors. If c = 0 cell is unchanged or set green (if in character mode). SET(10,0,1) SET(L1,L2,C) | ||||||||||||||||||
| SKIPF | Positions cassette tape at end of next file. SKIPF"PROGRAM" SKIPF | ||||||||||||||||||
| SOUND(f,d) | Sounds the frequency (f = 1-255) and duration (d = 1-255) specified. SOUND 1,200 SOUND 128,5 | ||||||||||||||||||
| STOP | Stops execution of a program. STOP |
|   |
| Dec | Hex | PRINT CHR$(code) |
| 8 | 08 | Backspaces and erases current character. |
| 13 | 0D | Line feed with carriage return. |
| 32 | 20 | Space |
|   |
| Abbreviation | Explanation |
| /0 | Division by 0 |
| BS | Subscript out of range |
| CN | Can't continue |
| DD | Redimensioned array |
| FC | Illegal function call |
| FM | Bad file mode |
| ID | Illegal direct |
| I/O | Input/Output error |
| LS | String too long |
| NF | NEXT without FOR |
| OD | Out of data |
| OM | Out of memory |
| OS | Out of string space |
| OV | Overflow |
| RG | RETURN without GOSUB |
| SN | Syntax error |
| ST | String formula too complex |
| TM | Type mismatch |
| UL | Undefined line |
|   |
| 1A3 | Printed in Korea 811011870A |