background image

Summary of Contents for 1000 MS-DOS

Page 1: ......

Page 2: ...ing 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 dis...

Page 3: ......

Page 4: ...ce 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 expres...

Page 5: ...17 Loading MS DOS 17 Making Backups 17 One Drive System 18 TwoDrive System 18 LoadingBASIC 19 Loading BASIC via BASICA 19 Options for Loading BASIC 20 Redirection of Input and Output 23 Chapter 3 Sam...

Page 6: ...6 Chapter6 Arrays 59 Types of Arrays 62 Defining Arrays 63 Chapter 7 Disk Files 67 SequentialAccess Files 67 Creating a Sequential Access File 68 Updating a Sequential Access File 69 Direct Access Fil...

Page 7: ...riables are Stored 357 Accessing String Variables 358 File Control Block 358 User Installed Devices 361 Information for Creating Child Processes 361 Messages 365 andDerived Functions 375 Charts 379 Ke...

Page 8: ......

Page 9: ...at 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 val...

Page 10: ...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 Information you supply to specify how a com m...

Page 11: ......

Page 12: ......

Page 13: ...0 Expanded graphics capabilities Disk Files BASIC uses the MS DOS multilevel directory structure on disk A formatted disk has a main directory called the root direc tory which is represented by the ba...

Page 14: ...accessed Filenames are 1to 8 characters long If a filename is more than 8 character BASIC truncates it to 8 characters Ext is an optional extension to the filename Use extensions to help distinguish...

Page 15: ...y names are MEMOS LETTERS EMPLOYEE In this manual directory names are in uppercase letters and filenames are in lowercase letters This lets you easily distin guish a directory name from a filename Wil...

Page 16: ...iers dev to indicate a physical device to be used for communication These names which must be enclosed in quotation marks are KYBD SCRN LPT1 COMn You can open any of these devicesjust as you would a d...

Page 17: ......

Page 18: ......

Page 19: ...MS DOS displays the proper format Next MS DOS loads and displays its prompt A This means that you are at the MS DOS command level where you can execute a program or command You should now make backups...

Page 20: ...rt the target diskette into Drive A Remove the MS DOSIBASIC diskette from Drive A and insert the newly formatted diskette Press SPACEBAR to be gin copying Shortly you are prompted to insert the so rce...

Page 21: ...immediately loads BASIC into the computer s memory B A S I C A ENTER loads the small loader program BASICA COM which in turn loads BASIC This alternate method of loading BASIC is dis cussed in detail...

Page 22: ...s control to it If BASICA COMdoes not find BASIC EXE it asks you to replace your program disk with a disk that contains the file Place a disk containing BASIC EXE in any drive and press m The program...

Page 23: ...epends on the value given for the FILES command in the CONFIG SYS file We recommend that you set FILES 10 for BASIC BASIC automatically reserves 4 files for internal use This leaves 6 for BASIC file I...

Page 24: ...Chapter 21Loading MS DOS and BASIC 22 Loading Method BASIC BASIC BASICA BASICA Number of Ports Buffer Size 1 64K bytes 2 32K bytes 1 40K bytes 2 20K bytes...

Page 25: ...ion Transcendental math package Redirection of Input and Output BASIC lets you redirect input and output The syntax to redirec tion is BASIC pathname input file loutput file1 You can redirect standard...

Page 26: ...nts for redirection of input and output 0 File input from the KYBD device still reads from the 0 File output to the SCRN device still outputs to the screen 0 BASIC still t r a p s keys when you use th...

Page 27: ......

Page 28: ......

Page 29: ...mistakes If there are no mistakes press I If you make a mistake use the tlkey to move the cursor to the mis take and retype the rest of the line to correct the mistake 1 0 A W I L L I A M SHAKESPEARE...

Page 30: ...e author bas use the fol lowing command MS DOS S A V E E B D O K S a u t h o r b a s ENTER Notice that BOOKS is located in the root directory since it is preceded by the root symbol You can also save...

Page 31: ...author wi1 loads the file author wi1 from the current directory on the cur rent drive Another way to load and run a program is to type RUN pathname RUN automatically loads and runs the program specifi...

Page 32: ......

Page 33: ......

Page 34: ......

Page 35: ...e line until you type RUN and press m If the first character is not a digit BASIC tries to execute the line as a command For example if you type M I L E S 1 3 3 G A L L O N 1 1 M P G M I L E S G L L O...

Page 36: ...error and waits for you to make corrections Sample Editing Session This sample session shows how you can easily edit lines in BASIC Even though the sample is a BASIC program you can use the same proce...

Page 37: ...e cursor on the pre ceding word Press DELETE twice to delete We Press and then F J to put the quotation mark at the end of the statement Press ENTtRl to record the changes You can use the LIST com man...

Page 38: ...uppercase or uppercase1 lowercase mode changes the current character to a blank and advances the cursor 1position to the right backspaces the cursor erasing the first character to the left All charact...

Page 39: ...ions are set at every 8 characters moves the cursor 1position to the left moves the cursor 1position to the right moves the cursor up 1 row to the charac ter above the current cursor position moves th...

Page 40: ...rovides a quick and easy way to type certain BASIC keywords These keywords are associated with alphabetic characters A Z To enter these keywords press and hold down the ALTJ key while pressing the des...

Page 41: ...f the screen to the line printer LPT1 CTRL PRlNTJ is the line printer echo key which acts as a toggle switch If the echo is off pressing CTRL m once causes all characters sent to the screen to also be...

Page 42: ......

Page 43: ......

Page 44: ......

Page 45: ...A line number is always the first element of a program line In BASIC line numbers must be in the range 0 to 65529 In the sample program line the line number is 10 A BASIC statement follows the line nu...

Page 46: ...that represents it This is necessary since computers understand and process only numbers Here are some sample strings 1 3 7 MAIN STREET 255 CENTRAL AVE 25 dollars 250 2 4 Notice that numbers can be in...

Page 47: ...e the same range as single precision numbers Sample double pre cision numbers are 1010234567 8 7777651010 If a double precision number is more than 16 digits BASIC dis plays the number in scientific n...

Page 48: ...onstant If you use punctuation in the num ber it must be a string constant For example PR I NT 2 5 0 00 0 When BASIC encounters a data constant in a statement BASIC must determine how to store it If t...

Page 49: ...er reserved words may be imbedded in a variable name The following are examples of variable names A A1 ADDRESS ADDRESS OLD L L2 LEN2 LENGTH The 2 types of variables are string and numeric BASIC initia...

Page 50: ...and constants when declaring them dou ble precision declares the number a double precision exponential number For example BASIC stores the number 1 2D2 as a double precision number 120 See the next se...

Page 51: ...C initially classifies all variables as single precision you need to use DEFSNG only if one of the other DEF statements is used Defines specified variableb as double precision Defines specified variab...

Page 52: ...should not use such conversions in your program because most fractional numbers do not have exact binary representa tions You can avoid this by forcing the constant to be double pre cision such as A 1...

Page 53: ...data only used for string data only used for both numeric and string data used for numeric data only Arithmetic Operators Arithmetic operators perform operations on numeric data Both operands must be...

Page 54: ...It appends one string to another All operands must be strings and the resulting value is 1string For example P R I N T A P R I L SHOWERS I BRING MAY FLOWERS prints APRIL SHOWERS BRING MAY FLOWERS Rela...

Page 55: ...ional operators are used with strings BASIC compares the strings character by character When it finds 2 characters that do not match it checks to see which character has the lower value ASCII code The...

Page 56: ...lues usually from relational expressions and return a true or false result The following table describes the result for given the described truelfalse values Meaning of First Operator Operation Operan...

Page 57: ...e BASIC does a bit by bit com parison of the 2 values according to predefined rules for the spe cific operator Note that the operands are converted to integer type stored internally as 16 bit two s co...

Page 58: ...the expression X 5 first and raises that value to the 2 8 power before performing the multiplication If an expression contains multiple parentheses BASIC evaluates the innermost parentheses first Func...

Page 59: ......

Page 60: ......

Page 61: ...mally array elements start with Element 0 however to simplify this example it starts with Ele ment 1 You can modify the initial array element base number with the OPTION BASE statement You can use eac...

Page 62: ...nts As you enter the expenses the grocery expense is stored in A l the gas expense in A 2 and the clothes expense in A 3 Add these lines to the program to print the contents of Array A 1 0 0 RESTORE 1...

Page 63: ...W 1 LARS FOR WEEK NO W NO W ACR C Run this program and see how it works We simply added an other subscript to the original array Now instead of referring to an element by a row number only we refer to...

Page 64: ...or the Grocery category So A 1 2 1 contains the Grocery expense for the second week of the first month Types of Arrays Arrays may be of any type string integer single precision or double precision You...

Page 65: ...ning 6 elements and assigns element A 5 the value 388 Use this method only if your array contains fewer than 11 elements 8 10 If your array contains more than 11 elements you must use the DIM statemen...

Page 66: ......

Page 67: ......

Page 68: ......

Page 69: ...iles sequen tial access or direct access Sequential Access Files With sequential access files you can access data only in the same order as it was originally stored To read from or write to a particul...

Page 70: ...N inputs data from the keyboard and stores it in variable N 3 To write data to the file use the WRITE statement you also can use PRINT but be sure you delimit the data For example WRITE 1 N writes va...

Page 71: ...I N P U T A S 1 opens the file named 1ist dut for sequential input using Buffer 1 6 To read data from the file and assign it to program variables use either INPUT or LINE INPUT For example I N P U T...

Page 72: ...a tion stored in the updated file add the following lines 7 0 OPEN li5t dat FOR I N P U T AS 1 8 0 I F E O F C I THEN 2 0 0 9 0 I N P U T 1 N 1 0 0 P R I N T N 1 1 0 GOTO 8 0 2 0 0 CLOSE 1 After you h...

Page 73: ...ile 1 To create the file open it for random access in Random mode R For example OPEN R 1 l i s t i n g d a t 3 2 opens the file named listing dat gives Buffer 1 direct access to the file and sets the...

Page 74: ...ign at the end of a variable speci fies that it is an integer variable The following program writes information to a direct access file 1 0 OPEN R 1 l i 5 t i n g d a t 3 2 2 0 F I E L D 1 2 0 A S NS...

Page 75: ...the GET statement to read the record you can check to see if the record is in your file Set a variable in your program equal to the record size you used in the OPEN statement LOF returns the length of...

Page 76: ...is program prints the contents of that record 10 OPEN R 1 l l 5 t l n g d a t 32 20 FIELD 1 20 A S N 4 A S A 8 A S P 30 RECSIZE 32 50 IF CODE 0 OR CODE LOF l RECSIZE THEN 1000 60 GET I CODE 70 PRINT N...

Page 77: ......

Page 78: ......

Page 79: ...n Medium resolution High resolution 160 x 200 points 320 x 200 points 640 x 200 points The horizontal length x axis is given first followed by the verti cal length y axis Notice that there are more ho...

Page 80: ...screen mode that supports 2 4 or 16 color sets All modes start with the background as black and the foreground as white Each color set has a defined list of colors called a palette The characteristic...

Page 81: ...are Number Color 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 black blue green cyan red magenta brown gray dark gray light blue light green light cyan light red light magenta yellow white The foreground col...

Page 82: ...modes are numbered 1 6 Screen Mode 0 Text Mode Color Set 16 Graphics Resolution not available Text Width 40 or 80 Video Page Size If WIDTH 40 2048 bytes 8 pages max If WIDTH 80 4096 bytes 4 pages max...

Page 83: ...ze Max No of Pages Screen Mode 4 Color Set Graphics Resolution Aspect Ratio Text Width Video Page Size Max No of Pages Screen Mode 5 Color Set Graphics Resolution Aspect Ratio Text Width Video Page Si...

Page 84: ...ify specific points as coordinates they are re ferred to as absolute coordinates You may also in some commands specify coordinates relative to the current point on the screen In this case you specify...

Page 85: ......

Page 86: ......

Page 87: ...finition of keyword Detailed definition of keyword and any parameters or argu ments for that keyword Example s1 Sample ProgramW This format varies slightly depending on the complexity of each keyword...

Page 88: ...period Terms Used in Chapter 10 line integer string number A numeric expression that identifies a BASIC program line Each line has a number in the range 0 to 65529 Any integer expression It may consi...

Page 89: ...hanges the current directory draws an ellipse on the screen frees memory for data without erasing the program in memory closes access to a disk file clears the screen selects background and either for...

Page 90: ...ss file or transfers a specific number of bytes from a communications file transfers graphic images from the screen to memory transfers program control t o a subroutine transfers program control to th...

Page 91: ...ces a portion of a string creates a directory renames a disk file erases a program from RAM generates noise through a TV monitor s speaker branches to a subroutine when activity occurs on the communic...

Page 92: ...a specified posi tion on the screen lists data to the display lists data to the display in a specific format writes data to a sequential access file writes data to a sequential access file us ing the...

Page 93: ...ngth of time stops program execution enables the STRIG function controlsjoystick event trapping exchanges the values of variables returns to MS DOS controls timer event trapping turns off the tracer t...

Page 94: ...mber to an integer returns the cosine of a number converts a number to single precision returns the current row position of the cursor restores data from a direct access disk file to double precision...

Page 95: ...urrent disk file record num ber or the number of characters in a com munications input queue returns the total number of bytes in a disk file or the amount of free space in a communication file input...

Page 96: ...s the ASCII code for the character stored a t a specific position on the screen determines the sign of a number returns the sine of a number returns a string of spaces prints spaces to the display ret...

Page 97: ......

Page 98: ......

Page 99: ...zero Example P R I N T ABS 66 prints the absolute value of 66 which is 66 X ABS Y computes the absolute value of Y and assigns it to X Sample Program 1 0 0 I N P U T WHAT S THE TEMPERATURE OUTSIDE7 D...

Page 100: ...ou can use ASC to be sure a program is receiving proper input Suppose you want to write a program that requires the user to input hexadecimal digits 0 9 A F To be sure that only those characters are i...

Page 101: ...radians BASIC always returns the result as a single precision number unless you specified the D switch when starting up BASIC To convert this value to degrees use ATN number PI where PI equals 3 14159...

Page 102: ...you omit increment and the comma BASIC uses 10 If you omit line but include in crement BASIC begins numbering with Line 0 If BASIC generates a line number that already exists in mem ory it displays a...

Page 103: ...a television s speaker or both BEEP ON SOUND ON directs sound t o both speakers BEEP OFF SOUND OFF t u r n s off sound t o both speakers BEEP ON SOUND OFF directs sound to the internal speaker only B...

Page 104: ...the one given when the program was saved and uses the current segment address as set by the last DEF SEG statement Unless you want to load the file into BASIC s data segment you must execute the DEF S...

Page 105: ...5 0 L P R I N T AT ADDRESS I WE HAVE A VALUE 6 0 NEXT I 7 0 BSAVE prog1 0 50 8 0 P R I N T N o w R u n Program 2 to verify that the OF VLUE content5 saved in the file PROGl match those in the printou...

Page 106: ...u omit any of them BASIC returns an error and terminates the save A memory image file is a byte for byte copy of what is in mem ory The BSAVE statement lets you save data or programs as memory image f...

Page 107: ...pected by the assembly language subroutine If you omit parameter list BASIC executes an 8086 CALL in struction Your assembly language subroutine should return with a simple RET instruction When you ex...

Page 108: ...Transfers program control to a routine written in MS FOR TRAN CALLS works just like the CALL statement except that CALLS passes arguments as segmented addresses CALLS uses the address given in most r...

Page 109: ...function may be useful if you want to force an operation to be performed in double precision even though the operands are single precision or integers Sample Program 2 1 0 A 4 5 4 6 7 2 2 0 PRINT A C...

Page 110: ...the first program line of the chained program The ALL option tells BASIC to pass every variable in the cur rent program to the chained program If you omit ALL the cur rent program must contain a COMMO...

Page 111: ...P R I N T 1 0 REM THE STATEMENT D I M A S 2 B S 2 MAY ONLY 20 REM HENCE I T DOES NOT APPEAR I N T H I S MODULE 3 0 REM SAVE T H I S MODULE ON THE D I S K A S 4 0 COMMON A S 0 B S O 50 PR INT P R I N...

Page 112: ...sing the A option Load mainprog bas and run it Your screen should display MAINPROG BAS HAS CHAINED TO OVERLAY1 BAS OVERLAY1 BAS HAS CHAINED TO OVERLAY2 BAS Hints The CHAIN statement with the MERGE opt...

Page 113: ...directory specification as defined in Chap ter 1 Examples C H D I R B f CCTS RECVBLE changes the currect directory on Drive B to ACCTS RECVBLE C H D I R RECORDS changes the directory on the current d...

Page 114: ...s commonly used to send a special character to the display See Appendix B for a list of ASCII codes Example prints the character corresponding to ASCII code 35 which is P R I N T C H R 3 5 Sample Prog...

Page 115: ...number to integer Number must be in the range 32768 to 32767 CINT rounds the fractional portion of number to make it an integer See also FIX and INT which also return integer values Examples P R I N T...

Page 116: ...s is the major axis of the ellipse Start and end are the beginning and ending angles in radians and must be in the range 6 283186 to 6 283186 or 2 PI to 2 PI where PI equals 3 141593 If you specify a...

Page 117: ...wider and shorter the ellipse For example in Screen Mode 1 an aspect ratio of 1 2 gives you an ellipse like this To draw an ellipse that is higher than it is wide use an aspect ratio that is larger th...

Page 118: ...ates Examples 1 0 SCREEN 1 2 0 C I R C L E 1 5 0 1 0 0 5 0 draws a circle with the center at point 150 100 and a radius of 50 Sample Program 1 0 SCREEN 1 2 0 FOR 1 0 TO 3 3 0 CLS 4 0 C I R C L E 1 5 0...

Page 119: ...e M switch when BASIC was loaded This option is useful if you will be loading an assembly language subroutine because it prevents BASIC from using that memory area Stack space also must be an integer...

Page 120: ...Note BASIC allocates string space dynamically BASIC displays an Out of string space error if no free memory is left for BASIC Examples clears all variables and closes all files CLEAR CLEAR 4 5 0 0 0...

Page 121: ...that contains an open file Close the file first because the last records may not have been written yet Closing the file writes the data currently in the buffer if it has not been written already Note...

Page 122: ...t is active CLS clears only the active viewport To clear the entire screen you must use VIEW to redefine the en tire screen before using CLS Changing the screen mode with SCREEN or changing the width...

Page 123: ...ing 0 as the foreground color causes an Illegal Function Call error Colors are described in Chapter 8 Displaying Color and Graphics Note If you set foreground the same as background the characters are...

Page 124: ...ed foreground with a blue background Line 20 draws a light red diagonal line on the display 5 SCREEN 1 10 C O L O R 3 0 20 L I N E 0 0 319 199 Line 10 selects a cyan background and Palette 0 Line 20 d...

Page 125: ...ined in the 16 Color Set in Chapter 8 Background is an integer in the range 0 to 7 specifying the background color COLORiText can use any of the colors in the 16 Color Set as fore ground See Chapter 8...

Page 126: ...m control to the line number specified in the ON COM GOSUB statement The COM STOP statement temporarily halts communications trapping If activity occurs on the communications channel BASIC does not tr...

Page 127: ...N T YOU ARE R E C E I V I N G DATA Line 2 0 0 RETURN 10 turns on a communications trar on Channel 1 If char acters are received on the communications channel program control transfers to the subrouti...

Page 128: ...The size and order of the vari ables must be the same in the programs being chained To spec ify array variables append 0 to the variable name If you are passing all variables use CHAIN with the ALL op...

Page 129: ...or other wise changing your program CONT is also invalid after execu tion has ended normally See the STOP statement to terminate execution and the GOT0 statement to begin execution at a specific line...

Page 130: ...you can convert it to radians by using COS number PI 180 where PI equals 3 141593 BASIC always returns the result as a single precision number unless you specified the D switch when starting up BASIC...

Page 131: ...gle precision BASICrounds the number when converting it to single precision Example P R I N T C S N G C 1 4 5 3 8 8 5 5 0 9 prints 1453885 Sample Program 2 8 0 VU 8 7 6 2 3 4 5 6 7 8 U 2 9 0 P R I N T...

Page 132: ...Function CSRLIN Returns the current row position of the cursor See the POS function to return the current column position and the LOCATE statement to set the row and column positions Example 10 PRINT...

Page 133: ...converts a 2 byte string to an integer CVD CVI and CVS are the inverse of MKD MKI and MKS respectively Examples A CVD GROSSPAY assigns the numeric value of GROSSPAY to the double precision variable A...

Page 134: ...starting with the first constant in the first DATA statement and ending with the last item in the last DATA statement String constants containing delimiters such as leading or trail ing blanks colons...

Page 135: ...significant DATA 2 7 2 3 1 4 0 0 1 7 4 5 5 7 2 9 5 7 8 stores 4 numeric data items DATA S M I T H T H 3 8 THORN J R 4 1 stores both types of constants Quotation marks are required around the first and...

Page 136: ...arate the month day and year You may use any of the following forms to set the current date mmlddlyy mmlddlyyyy mm dd yy mm dd YYYY The month mm may be any number 01 12 The day dd may be any number 01...

Page 137: ...ATES 9 6 8 4 DATE 9 6 1 9 8 4 DATES 9 6 8 4 DATES 9 6 1 9 8 4 All the above set the current date as 09 06 1984 P R I N T DATES prints the current system date CURDATES DATES assigns the value of the cu...

Page 138: ...For example A J Remember a type declaration tag always takes precedence over a DEF statement Examples DEFDBL L P classifies all variables beginning with the letters L through P as double precision var...

Page 139: ...ffect variables in your program with the same name Expression defines the operation to be performed A variable used in a function definition may or may not appear in argument list If it does BASIC use...

Page 140: ...fts the value to the left 4 bits which is the same as multiply ing it by 16 decimal 10 hexadecimal Note BASIC does not check the validity of the result ant segment offset address When you load BASIC t...

Page 141: ...acing With Assembly Language Subrou tines in Chapter 11for more information Example 10 DEF SEG HB800 Set segment to 8 0 0 H e x 20 DEF SEG Restore to BASIC data segment sets the DS register to B8000 h...

Page 142: ...e the USR function If the subroutine is not in BASIC s data segment you must exe cute a DEF SEG statement before the USR function A program may contain any number of DEF USR statements al lowing acces...

Page 143: ...ecify a line number that does not exist BASIC displays an Illegal function call error You can substitute a period for either linel or line2 to indicate the current line number Examples deletes Line 70...

Page 144: ...s executed When you execute the DIM statement BASIC reserves space in memory for each element of the array Each element is initially set to zero for numeric arrays or null for string arrays If you do...

Page 145: ...point plotted with another graphics command such as LINE or PSET The current position defaults to the center of the screen if no previous graphics command has been executed Moves up n points Moves dow...

Page 146: ...vided by 4 For exam ple if factor is 2 the scale factor is 214 To determine the actual travel distance multiply the scale factor by the number in the movement commands If you do not specify a factor B...

Page 147: ...4 0 5 0 SCREEN 0 R40 II draws a rectangle on the screen 5 SCREEN 3 R40 I 2 0 DRAW XU X R B XDS X L 3 0 A I N K E Y I F A THEN 30 4 0 SCREEN 0 1 0 U U 3 0 D D 3 0 L aL40 1 R draws the same rectangle a...

Page 148: ...SIC displays line for editing You can substitute a period for line to indicate the current line number See Chapter 4 General Information for more information on editing and special keys Examples EDIT...

Page 149: ...ome point other than the last sequential line An END statement at the end of a program is optional Sample Program 4 0 I N P U T S 1 S 2 50 GOSUB 1 0 0 5 5 P R I N T H 6 0 END 1 0 0 H S Q R S l S l S 2...

Page 150: ...he parameter from the Environment String Table and compresses the table Parameter i d text must be enclosed in quotation marks and be typed in all uppercase characters When you change a parameter in t...

Page 151: ...ition within the table ENVIRON returns the text string for the number parameter If there is not a parameter in that position ENVIRON returns an empty string If you omit number you must specify paramet...

Page 152: ...read When used with direct access files EOF returns 1 true if the last executed GET statement was unable to read an entire record because of an attempt to read beyond the physical end of the file Samp...

Page 153: ...is empty EOF becomes false when the input queue is not empty Sample Program These lines are useful in a program when you want to run the program while waiting for communications activity 1 0 OPEN C O...

Page 154: ...redimension arrays or use their previously allocated space in memory for other purposes If one of the parameters of ERASE is a variable name that is not used in the program an Illegal function call o...

Page 155: ...or within MS DOS as set by the Interrupt 24 handler The lower 8 bits of ERDEV contain the In terrupt 24 error code For more information on device drivers and errors see the Pro grammer s Reference man...

Page 156: ...error occurred on a character device ERDEV returns the 8 byte character device name If the error does not occur on a character device ERDEV re turns the 2 character block device name For more informat...

Page 157: ...an error handling routine If no error has occurred ERL returns a 0 If a statement entered at BASIC s prompt causes the error ERL returns line number 65535 the largest number that can be represented in...

Page 158: ...aningful inside an error handling routine ac cessed by ON ERROR GOTO See Chapter 12 for a list of error codes Example branches to Line 1000 if the error is an Out of memory error code 7 if it is any o...

Page 159: ...e has occurred Refer to Chapter 12 for a listing of error codes and their meanings Example ERROR 1 causes a NEXT without FOR error Code 1 when BASIC reaches this line Sample Program 1 1 0 ON ERROR GOT...

Page 160: ...or equal to 88 02968 This function is the inverse of the LOG function therefore num ber EXP LOG number BASIC always returns the result as a single precision number unless you specified the D switch wh...

Page 161: ...he record length assigned when you opened the file An OPEN statement assigning the buffer number must precede the FIELD statement FIELD must precede GET and PUT You may use the FIELD statement any num...

Page 162: ...eld Of course this value would be meaningless unless you previously have used GET to read a 256 byte record from disk FIELD 3 1 2 8 A S A 1 2 8 AS BS FIELD 3 16 AS NM 2 5 A S ADS 1 0 A S C Y 2 A S S T...

Page 163: ...irec tories in the current directory on the current drive Pathname may contain question marks and asterisks as wild cards See the section on wild cards in Chapter 1for more information If you specify...

Page 164: ...FILES B O O K S lists all files in the directory BOOKS F I LE5 b a s lists all files in the current directory on the current drive with the extension bas FILES p a y ba5 lists all files beginning wit...

Page 165: ...trips the fractional portion from number so that the resultant value is a whole number The result is the same precision as the argument except for the fractional portion Unlike INT FIX does not return...

Page 166: ...decreases the initial value each time through the loop In this case the fi nal value must be less than the initial value BASIC executes the program lines following the FOR statement until it encounter...

Page 167: ...ntext of another FOR NEXT loop The NEXT statement for the inside loop must appear before the NEXT for the outside loop If nested loops have the same end point a single NEXT statement may be used for a...

Page 168: ...able you can use the NEXT state ment to close nested loops Be sure not to type the variables out of order For example delete Line 920 and change 930 to 930 NEXT J I If you omit the variables in nested...

Page 169: ...specify a numeric argument BASIC returns the amount of memory available If you specify a string argument BASIC compresses the data before returning the amount of memory available This frees unused mem...

Page 170: ...other BASICs Record is an integer in the range 0 to 16 777 215 that specifies which record number you want to access If you omit record BASIC reads the next sequential record after the last GET When...

Page 171: ...M statement Note Because of the low performance associated with telephone line communications we recommend that you not use GET and PUT statements in such appli cations Instead use the other disk 110...

Page 172: ...hold the image It must be dimen sioned large enough to hold the entire image To ensure that the array is large enough t o hold the image use the following formula 4 INT F b 7 8 u where h is the length...

Page 173: ...atements to gether for animation and high speed object motion in the graph ics modes See also PUTiGraphics statement the x dimension of the image the y dimension of the image Note GET and PUT work fas...

Page 174: ...t returns to the state ment that follows the GOSUB GOSUB is similar to GOT0 in that it may be preceded by a test statement Example GOSUB 1 0 0 0 branches to the subroutine at Line 1000 Sample Program...

Page 175: ...If not BASIC branches to Line 200 You can use GOTO in the command mode as an alternative to RUN This lets you pass values assigned as a command to vari ables used in the program Example GOTO 1 0 0 BA...

Page 176: ...al value of number Since the value returned is like any other string you cannot use it in a numeric expression You cannot add hex strings however you can concatenate them Examples PRINT H E X 3 0 H E...

Page 177: ...BASIC executes the THEN statement If expresswn is false BASIC executes the matching ELSE statement or the next program line You can also use IFiTHEN to test the numeric value of a vari able If the va...

Page 178: ...ne 400 If A is any value besides NO or YES BASIC branches to Line 370 4 0 0 ELSE 3 7 0 Sample Program IFiTHENiELSE statements may be nested However you must take care to match up the IFs and ELSEs If...

Page 179: ...eset is not passed to INKEY Note If your program contains an INKEY and you press a function key BASIC returns 1character of the key assignment at a time For example suppose this statement is executed...

Page 180: ...INP Function INP port Returns the byte read from port Port may be any integer from 0 to 65535 INP is the complementary function of the OUT statement Example 1 0 0 A INP 255 returns the byte read from...

Page 181: ...prompt BASIC suppresses the question mark when printing the prompt Variable may be 1or more string or numeric variables to receive the input If you specify more than 1variable separate them by commas...

Page 182: ...this line you must type in a string The string does not have to be enclosed in quotation marks unless it contains a comma a colon or a leading blank I N P U T ENTER YOUR NAME AGE N A prints the promp...

Page 183: ...lly That is when the file is opened a pointer is set to the beginning of the file The pointer advances each time data is input To start reading from the beginning of the file again you must close the...

Page 184: ...ends input when it encounters a carriage re turn or a comma unless the first character is a quotation mark If the first character is a quotation mark BASIC ends input when it encounters a second quot...

Page 185: ...with other BASICs When inputting the string from the keyboard BASIC waits until the user enters the number of characters specified by number You do not need to press m to signify end of line The char...

Page 186: ...IC prompt returns type PRINT F 1 1 0 L I N E I N P U T TYPE I N THE F I L E N A M E E X T F 1 2 0 P R I N T TYPE I N THE PASSWORD MUST TYPE 8 CHARACTERS 1 3 0 P I N P U T 8 1 4 0 F F I P 1 5 0 P R I N...

Page 187: ...starts searching at the first character in stringl If BASIC finds string2 in stringl it returns the starting position of the match otherwise it returns zero If the entire substring is not contained in...

Page 188: ...a found in the address 360 RESTORE 3 7 0 COUNTER 0 3 9 0 READ ADDRESS 3 9 5 I F ADDRESS SEND THEN 4 1 0 4 0 0 I F INSTRCADDRESSS 7 6 1 0 THEN COUNTER COUNTER 1 ELSE 390 4 0 5 GOT0 390 4 1 0 P R I N T...

Page 189: ...or equal to number Number is not limited to the integer range 32768 to 32767 The result has the same precision as number except for the frac tional portion Unlike CINT INT does not round positive num...

Page 190: ...e commands are generally 2 to 3 charac ters long and may be followed by an alphanumeric argument The commands are separated by semicolons String may be a maximum of 255 bytes For more information on d...

Page 191: ...l It is provided for compatibility with other BASICs You can use the IOCTL function to confirm that a IOCTL statement succeeded or failed You can also use IOCTL to get information from the device For...

Page 192: ...cter Initially the function keys have these values F1 LIST F7 T R O N m F2 RUN F8 TROFF F3 LOAD F9 KEY F4 SAVE F1O SCREEN 0 0 0 ENTERI F5 CONT F11 none F6 L P T l m F12 none Function keys 11and 12 do...

Page 193: ...display program lines on Line 25 Note Instead of using KEY ON and KEY OFF you can use m TJ as a toggle switch to turn the key as signment display on and off as well as to cause it to advance to the ne...

Page 194: ...function key number 1 10 The cursor direction key trap num bers are 11 12 13 14 User defined keys are 15 20 Use the following syntax to define your own user keys KEY number CHR key CHR scan Key is on...

Page 195: ...3 ON ON K E Y 3 GOSUB 1 0 0 0 BASIC turns on a trap for m BASIC continues to execute the other program statements checking after each statement to see if iF3 has been pressed When IF3 is pressed BASIC...

Page 196: ...as described in Chapter 1 You may delete any type of disk file However if the file is cur rently open a File already open error occurs You must close the file before deleting it Example K I LL f i 1e...

Page 197: ...LCOPY Copies all text data on the screen to the printer Sample Program 5 5 0 FOR 1 1 TO 2 4 5 6 0 PRINT S T R I N G 7 9 3 3 5 7 0 NEXT I 5 8 0 LCOPY This program segment prints exclamation points on t...

Page 198: ...prints BATTLE P R I N T L E F T S B A T T L E S H I P S 6 P R I N T L E F T C B I G F I E R C E DOG 28 Since BIG FIERCE DOG is fewer than 20 characters BASIC prints the whole phrase Sample Program 7...

Page 199: ...LEN string Returns the number of characters in string Blanks are counted Examples X LEN SENTENCES gets the length of SENTENCE and stores it in X P R I N T LEN CAMBR1DGE LEN BERKELEY prints 17 P R I N...

Page 200: ...ASIC does not require assignment statements to begin with LET but you might want to use LET to be compatible with ver sions of BASIC that do require it Examples L E T A A ROSE I S A ROSE L E T E1 1 2...

Page 201: ...playing Color and Graphics for information on coordinates and colors for the current screen mode If you specify coordinates that are not in the range of the cur rent viewport BASIC displays only that...

Page 202: ...mode LINE 319 199 draws a line from the last point referenced to point 319 199 in the default color This is the simplest form of the LINE state ment Note that when you omit the beginning points you mu...

Page 203: ...eate a loop that draws random lines on the video display 4 0 F O R X O TO 3 1 9 6 0 NEXT 5 0 L I N E X B X 1 9 9 X FlND 1 In Screen Modes 1 to 6 Lines 40 60 draw an alternating pat tern turning on and...

Page 204: ...only way to terminate the string input is to press I However if LINE INPUT is immediately followed by a semicolon pressing ENTER does not echo a carriage return to the display Note You must place a s...

Page 205: ...following the usual restrictions regarding leading char acters and terminators LINE INPUT reads everything from the first character up to 0 the end of file the 255th data character 0 a carriage return...

Page 206: ...creen or LPT1 line printer 1 If you omit deuice the lines are listed to the screen You can temporarily stop the listing by pressing HOLD1 Press HOLDJ again to continue the listing You can substitute a...

Page 207: ...ur program If you omit both startline and endline BASIC lists the entire program You can substitute a period for either startline or endline to indicate the current line number LLIST assumes an 80 cha...

Page 208: ...d runs the program automatically If you omit the R option BASIC wipes out any resident BASIC program clears all variables and closes all open files You can use either of these commands inside programs...

Page 209: ...he last GET or PUT statement When used with sequential files LOC returns the number of 128 byte blocks that have been read or written Example I F L O C 1 5 5 THEN END Program execution ends if the cur...

Page 210: ...y using the C option when loading BASIC Example 1 0 X L O C I 2 0 I f X 0 THEN A INPUT LOC l I Line 18 checks to see if there are any characters in the input queue and stores the number of characters...

Page 211: ...s visible or invisible Set cursor to 1 for a visible cursor and to 0 for an invisible cursor Start specifies the starting scan line of the cursor There are 7 scan lines available for the cursor Start...

Page 212: ...8 AS A 1 5 6 0 RCNUM 1 START AT B E G I N N I N G OF F I L E 1 5 7 0 R C S I Z 1 2 8 SET RECORD S I Z E 1 5 8 0 I F RCNUM R C S I Z L O F 1 GOTO 1 6 4 0 1 5 9 0 CHECK FOR END OF F I L E 1 6 0 0 GET 1...

Page 213: ...assigned to the file when you opened it You can use LOF to determine when an input queue is getting full so that transmission is stopped The default length of the communications receive buffer is 256...

Page 214: ...amples PRINT LOG 3 14159 prints the value 1 144729 Z 10 LOG PS Pl performs the indicated calculation and assigns the value to Z Sample Program This program demonstrates the use of LOG It utilizes a fo...

Page 215: ...eturn For example if you are printing a string of 20 characters and the 10th character is the ASCII code for a carriage return the printer advances to the next line after printing the ninth character...

Page 216: ...WIDTH statement with the LPRINT option See PRINT and PRINT USING for more information on format ting the output Examples LPRINT A 2 3 prints the value of expression A 2 3 on the printer LPRINT TAB S0...

Page 217: ...ht If the variable is larger than the field char acters are truncated on the right The complement command to LSET is RSET See also Chapter 7 Files and OPEN CLOSE FIELD GET PUT and RSET Example Suppose...

Page 218: ...es from pathname are numbered 75 85 and 90 and 3 lines from the resident program are numbered 70 80 and 90 When you use MERGE on the 2 programs this portion of the merged program is now numbered 70 75...

Page 219: ...owing subroutine sub txt is stored on disk in ASCII format 9 0 GOSUB 1 0 0 0 SUBROUTINE HOOK 1 0 0 0 REM B E G I N N I N G OF SUBROUTINE 1 0 1 0 REM SUBROUTINE L I N E 1 0 2 0 REM SUBROUTINE L I N E 1...

Page 220: ...u want to change Length is a number specifying the number of characters you want to replace Newstring is the string to replace a portion of oldstring The length of the resultant string is always the s...

Page 221: ...of the character at the start position including that character at start If start is greater than number of characters in string BASIC re turns a null string Examples 1 0 A WEATHERFORD 2 0 P R I N T...

Page 222: ...e directory is cre ated on the current drive If you omit the root directory symbol I the directory is created in the current directory Examples MKDIR A ACCTS PAYABLE creates the directory PAYABLE in t...

Page 223: ...lues that make up the number are not changed only 1 byte the internal data type specifier is changed so that numeric data can be placed in a string variable MKD returns an 8 byte string MKI returns a...

Page 224: ...old filename as new filename With this statement the data in the file is left unchanged The new filename may not contain path password or drive specification You can only rename a file in the current...

Page 225: ...I BASIC Kevwords NEW Statement NEW Deletes the program currently in memory and clears all vari ables NEW also closes all open files turns off the trace function and resets the music background Exampl...

Page 226: ...White Frequency 0 4 35795451512 1 5 357954511824 2 6 357954512048 3 7 frequency of Voice 2 see Volume is an integer in the range 0 to 15 where 0 is the quietest and 15 is the loudest Duration is a nu...

Page 227: ...hat represents the octal value of a deci mal number The value returned is like any other string it can not be used in a numeric expression Examples P R I N T O C T C 3 0 O C T S 0 O C T 9 0 prints the...

Page 228: ...to exit the subroutine BASIC executes the ON COM GOSUB statement only if a COM ON statement has been previously executed to enable communication trapping If a COM STOP statement has been issued to ha...

Page 229: ...OR I 1 TO 1 0 4 0 P R I N T I 5 0 NEXT I 1 0 0 0 SUBROUTINE CODE 1 0 5 0 RETURN 2 0 0 If activity occurs on Communication Channel 1 while the FOR NEXT loop is executing BASIC immediately executes the...

Page 230: ...ERROR GOTO 0 which causes BASIC to stop execution and print an error message This is rec ommended for errors that are trapped and from which you can not recover Note If an error occurs during executio...

Page 231: ...eger before evaluating it If n is 0 or greater than the number of line numbers listed BASIC continues with the next statement If n is negative or is greater than 255 an Illegal function call error occ...

Page 232: ...C Keywords Sample Program 4 3 0 I N P U T CHOOSE 1 2 OR 3 I 4 4 0 ON I GOSUB 5 0 0 6 0 0 7 0 0 4 5 0 END 5 0 0 P R I N T SUBROUTINE I RETURN 6 0 0 P R I N T SUBROUTINE 2 RETURN 7 0 0 P R I N T SUBROUT...

Page 233: ...ement If n is negative or is greater than 255 an Illegal function call error occurs Example 1 0 ON M I GOTO 1 5 0 1 6 0 1 7 0 1 5 0 1 8 0 tells BASIC to evaluate MI If MI equals 1 BASIC branches to Li...

Page 234: ...apping for that key It is the same as executing a KEYO OFF statement Use the RETURN statement to exit the subroutine BASIC executes the ON KEYO GOSUB statement only if a KEYO ON statement has been exe...

Page 235: ...E Y 1 ON 3 0 ON K E Y 5 GOSUB 8 0 4 0 ON K E Y 1 GOSUB 1 0 0 5 0 FOR I 1 TO 1 0 0 6 0 P R I N T NO KEY PRESSED 7 0 NEXT 1 E N D 8 0 P R I N T K E Y 5 PRESSED I 9 0 RETURN 1 0 0 P R I N T KEY 1 PRESSE...

Page 236: ...BASIC executes the ON PEN GOSUB statement only if a PEN ON statement has been executed previously to enable light pen trapping If a PEN STOP statement has been issued to halt trapping for the pen temp...

Page 237: ...0 0 0 3 0 REM 5 0 0 END 1 0 0 0 REM PROCESSING ROUTINE 1 1 0 0 RETURN 3 0 Line 10 turns on pen trapping After each program statement is executed BASIC checks to see if the pen has been activated If i...

Page 238: ...N PLAY GOSUB statement only when playing background music PLAY MB and if the PLAY ON statement has been executed to enable event trapping If a PLAY STOP statement has been issued to halt event trap pi...

Page 239: ...suggested that the trap number be less than 16 for better performance Example 1 0 P L A Y ON 2 0 ON P L A Y 2 GOSUB 3 0 REM 5 0 0 END 1 0 0 0 REM PROCESSING 1 1 0 0 RETURN 3 0 1 0 0 0 R O U T I N E Li...

Page 240: ...rn off trapping for the joysticks Use RETURN to exit the subroutine BASIC executes the ON STRIGO GOSUB statement only if a STRIG ON statement has been executed previously to enable joystick trapping I...

Page 241: ...N T You pressed the right button RETURN Lines 10 and 20 turn on joystick trapping Line 30 instructs you to press one of the buttons Line 40 waits for you to press a but ton If you press the left butt...

Page 242: ...r Use RETURN to exit the subroutine BASIC executes the ON TIMER0 GOSUB statement only if a TIMER ON statement has been executed previously to enable time event trapping If a TIMER STOP statement has b...

Page 243: ...0 GOSUB 1 0 0 0 3 0 REM 5 0 0 END 1 0 0 0 REM PROCESSING ROUTINE 1 1 0 0 RETURN 3 0 Line 10 turns on timer trapping After each statement is exe cuted BASIC checks to see if the specified time has elap...

Page 244: ...for communication Record length is an integer in the range 1 to 32768 that sets the record length for direct access files If you omit record length BASIC assumes a default record length of 128 bytes D...

Page 245: ...does not exist BASIC creates the file If you open a file for append that does not exist BASIC creates the file and sets the mode to RANDOM If you open a file for direct access with a record length tha...

Page 246: ...ng the parity to be used when the data is transmitted and received The constant must be one of the following E 0 M S N EVEN transmit parity EVEN receive parity checking ODD transmit parity ODD receive...

Page 247: ...s The RS option suppresses the Request To Send RTS signal Re quest To Send is a signal that is sent from the sending terminal to the receiving terminal to ensure that the receiving terminal is ready t...

Page 248: ...a Device Timeout error Specifying these options lets you ignore these signals or specify the length of time to wait for the signal The LF option sends a line feed character after every carriage return...

Page 249: ...ations Channel 1 at a rate of 300 bps with even parity 7 data bits and 1stop bit RTS is sent OPEN COM2 9600 N 8 1 BIN A S 2 opens Buffer 2 for Communications Channel 2 at a rate of 9600 bps with no pa...

Page 250: ...lue Sets value as the minimum value for an array subscript Value may be 1or 0 The default is 0 If you use this statement in a program it must precede the DIM statement If the statement OPTION BFISE 1...

Page 251: ...OUTport data byte Sends a data byte to a machine output port A port is an input output location in memory Port is an integer in the range 0 to 65535 Data byte is an integer in the range 0 to 255 Examp...

Page 252: ...inting and must be a color number in the current palette If you omit bor der BASIC assumes the value of color See Chapter 8 Displaying Color and Graphics for information on coordinates and colors for...

Page 253: ...BASIC does not execute the PAINT statement PAINT can fill any figure but painting jagged edges or very complex figures may result in an Out of memory error If this happens you must use the CLEAR stat...

Page 254: ...point on the screen That is each byte of the tile mask describes only 4 points These 2 bits describe the color for the point being drawn The following chart shows the values for the given colors Reme...

Page 255: ...as described in Chapter 8 Displaying Color and Graphics For example in Screen Mode 3 Color 1 is blue You can use the PALETTE statement to change it so that Color 1 is associated with a different colo...

Page 256: ...0 0 2 0 PALETTE 3 l 3 0 L I N E 0 1 0 0 3 1 9 1 0 0 3 4 0 P A I N T 1 1 0 0 3 6 5 0 PALETTE Line 10 selects Palette 0 as the current palette Line 20 changes position Number 3 from brown to blue Line 3...

Page 257: ...t 16 elements following sub script so that PALETTE USING has enough colors to fill the palette The array can be larger than the palette PALETTE USING stops filling the current palette when it reaches...

Page 258: ...as you need them You can expand the previous array for example Subscript Color 0 1 2 3 4 5 6 7 8 9 2 Green 10 Light Green 1 Blue 9 Light Blue 4 Red 12 Light Red 9 Light Blue 1 Blue 3 Cyan 11 Light Cya...

Page 259: ...s an integer representing a video page in memory to be copied The range depends on the current screen mode and the amount of video memory Destination page represents the video page to receive the copy...

Page 260: ...range 32768 to 65535 The value returned is an integer in the range 0 to 255 For the interpretation of a negative value of memory location see the VARPTR statement PEEK is the complementary function o...

Page 261: ...eturns the y coordinate vertical where the pen was last activated Returns a 1 if the pen button is being pressed Re turns a 0 if it is up Returns the l a s t known valid x coordinate horizontal Return...

Page 262: ...ASIC transfers program control to the line number specified in the ON PEN GOSUB statement The PEN STOP statement temporarily halts light pen trapping If the light pen is activated BASIC does not trans...

Page 263: ...black keys on a piano The letters A C D F and G may be followed by a plus because they are followed by black keys on a piano The letters A B D E and G may be followed by minus be cause they are prece...

Page 264: ...os plays as a dotted note BASIC plays the note one half its length longer You may use more than one dot after each note BASIC scales the length of time accordingly Dots may also appear after the P opt...

Page 265: ...required sets the volume n must be in the range 0 to 15 You must execute a SOUND ON statement to use this option If you omit volume BASIC uses 8 With the 0 N P and T commands n may also be a numeric...

Page 266: ...hannel 0 returns the number of notes left to play on voice channel 1 returns the number of notes left to play on voice channel 2 If you specify a number other than 0 2 BASIC assumes 0 The PLAY functio...

Page 267: ...that in the ON PLAYO GO SUB statement BASIC transfers program control to the line number specified The PLAY STOP statement temporarily halts background music trapping If the number of notes equals th...

Page 268: ...inate it may be any single precision floating point number Action is one of the following 0 returns the physical x coordinate for the specified world coordinate returns the physical y coordinate for t...

Page 269: ...e current physical x coordinate horizontal 1 returns the current physical y coordinate vertical 2 If WINDOW is active returns the world x coordinate 3 If WINDOW is active returns the world y coordinat...

Page 270: ...e 32768 to 65535 POKE is the complementary statement of PEEK The argument to PEEK is a memory location from which a byte is to be read PEEK and POKE are useful for storing data efficiently loading ass...

Page 271: ...ns the value 40 However be cause a blank is inserted before the 4 to accommodate the sign the 4 is actually at Position 41 Sample Program 1 5 0 CLS 1 6 0 FIF INKEYF 1 7 0 I F A I THEN 1 6 0 1 8 0 I F...

Page 272: ...INT item where the last one stopped If no trailing punctuation is at the end of the PRINT statement the cursor drops to the beginning of the next line If BASIC tries to print a string longer than it c...

Page 273: ...N A F Y OLD 1 0 0 PRINT IN THE Y E A R F Y O U WILL BE N YEARS Because F and N are positive numbers PRINT inserts a space before and after them therefore your display should look similar to this depe...

Page 274: ...format the field You may use more than 1 field spe cifier except as indicated Specifiers for String Fields prints the first character in the string only P R I N T U S I N G I PERSONNEL BASIC prints P...

Page 275: ...sign is printed in front of the number PRINT US I NG I I 1 1 1 22 PRINT US I NG I I 75 PRINT US I NG I 876 567 BASIC prints 111 22 0 75 and 876 57 respectively If the number of digits specified excee...

Page 276: ...with asterisks and prints a dollar sign immediately before the number PRINT USING I 8 333 BASIC prints 8 33 prints a comma before every third digit to the left of the decimal point The comma establish...

Page 277: ...ings F M and again Notice the 2 spaces in b b These 2 spaces insert the appropriate spaces after the initials of the name see below Also notice the use of the vari ables A for format and P for item li...

Page 278: ...tes on the screen For this reason be sure to delimit the data so that it will be input correctly from the disk PRINT does not compress the data before writing it to disk It writes an ASCII coded image...

Page 279: ...anks enclose them in quotation marks For example A CAMERA AUTOMATIC E 1 0 2 3 8 2 P R I N T 1 A E writes the data as C A M E R A M M M M M M M A U T O M A T I C l 8 2 3 8 2 An INPUT statement reads th...

Page 280: ...n to control how many characters of a value are written to disk For example suppose A LUDWIG B VAN and C BEETHOVEN Then the statement P R I N T 1 U S I N G MM A B C writes the data in nickname form L...

Page 281: ...for color If you use PSET color defaults to the foreground color If you use PRESET color defaults to the background color Note BASIC does not print and does not issue an er ror message for points the...

Page 282: ...it record the current record number is used If record is higher than the end of file record number then rec ord becomes the new end of filerecord number The first time you use PUT after opening a file...

Page 283: ...te Because of the low performance associated with telephone line communications we recommend that you not use GET and PUT statements in such applications Example PUT 2 8 0 transfers 80 bytes from comm...

Page 284: ...nate The x and y coordinates specify the coordinate of the upper left corner of the image If you omit x and y BASIC begins the im age at the last point referenced on the screen See Chapter 8 Displayin...

Page 285: ...1 2 13 3 0 3 12 4 11 5 10 6 9 7 8 8 7 9 6 10 5 11 4 12 3 13 2 14 1 15 0 AND transfers the image over existing image The result is a logical AND of the array and the image on the screen OR superimposes...

Page 286: ...e time between Steps 4 and 1 and by ensuring enough time delay between Steps 1 and 3 If you are animating more than 1 object process every object at the same time 1step at a time If preserving the bac...

Page 287: ...DOMIZE statement before the RND function You can use the TIMER function to ensure that the random number generator is reseeded with a different value each time BASIC executes the RANDOMIZE function Fo...

Page 288: ...ent If a program contains multiple DATA statements BASIC reads them in the or der they appear The values read must agree with the variable types specified in a list of variables otherwise a Syntax err...

Page 289: ...D and DATA statements 4 0 P R I N T NAME AGE 5 0 READ N 6 0 I F N END THEN P R I N T END OF L I S T END 7 0 READ AGE 8 0 I F A G E 1 8 THEN P R I N T N AGE 9 0 GOT0 5 0 1 0 0 DATFI S M I T H JOHN 3 0...

Page 290: ...listing of your program you can quickly interpret it If REM is used in a multistatement program line it must be the last statement in the line You may use an apostrophe 1 as an abbreviation for REM S...

Page 291: ...aring after GOTO GOSUB THEN ON GOTO ONiGOSUB ON ERROR GOTO RESUME and ERL You cannot use RENUM to change the order of program lines For example if a program has lines numbered 10 20 and 30 the command...

Page 292: ...0 RENUM renumbers from Line 5000 to the end of the program The first renumbered line becomes 600 and an increment of 100 is used between subsequent lines RENUM 1 0 0 1 0 0 renumbers the entire progra...

Page 293: ...l open files on all drives If a disk contains any open files RESET writes all blocks in memory to disk RESET ensures that all files on all diskettes are closed before you remove them from the drives R...

Page 294: ...ified DATA statement If you omit line BASIC resets to the first DATA statement in the program This lets your program reuse the same DATA lines Sample Program 1 6 0 RECID X 1 7 0 RESTORE 1 8 0 READ Y 1...

Page 295: ...uses the computer to branch to the specified line number RESUME NEXT causes the computer to branch to the state ment following the point at which the error has occurred Examples RESUME If an error has...

Page 296: ...nt remains active while a GOSUB subroutine is executing If BASIC returns to a line number that is outside these loops an error occurs because the loops were left incomplete If the program encounters a...

Page 297: ...e string Examples P R I N T RIGHT WATERMELON 5 prints MELON P R I N T R I G H T M I L K Y W A Y 2 5 prints MILKY WAY Sample Program 8 5 0 RESTORE ON ERROR GOTO 8 8 0 8 6 0 READ COMPANY 8 7 0 P R I N T...

Page 298: ...ectory is deleted from the current directory The directory being deleted must be empty except for the and symbols Use the MS DOS COPY command to move those files you want to save then use KILL to remo...

Page 299: ...ber generator If number is negative RND starts the sequence of random num bers at the beginning If number is 0 RND repeats the last number generated If you omit number or specify a positive value RND...

Page 300: ...data in a direct access buffer field name in preparation for a PUT statement Field name is a string variable defined in a FIELD statement This statement is similar to LSET The difference is that with...

Page 301: ...specify the R option BASIC does not close the open files before loading the new program into memory If you omit the R option BASIC closes all open files before loading the program RUN automatically cl...

Page 302: ...ASCII format BASIC programs are stored in RAM using compressed format Use the ASCII format if you plan to use the MERGE command to merge the program with another Also data programs that be read by oth...

Page 303: ...ves the resident program in compressed format as filel bas The file is placed on Drive A in the current directory SAVE E D U C m a t h p a k txt A saves the resident program in ASCII form using the na...

Page 304: ...the range of 0 to 255 and can be translated as follows attribute MOD 16 foreground color attribute foreground 16 MOD 128 background color number l27 is true 1 if the character is blinking and false 0...

Page 305: ...has no effect in high and low resolution Screen Modes 3 5 and 6 where color is always enabled or in Screen Mode 2 which is black and white Active page is an integer that selects the video page to whi...

Page 306: ...nd old page if mode or burst change Erase all video memory if mode or burst changes 0 1 2 If you omit erase BASIC assumes 1 If you omit any parameters except display page BASIC uses the previous value...

Page 307: ...ive number SGN returns 1 If number is zero SGN returns 0 Examples Y SGN A E determines the sign of the expression A B and passes the ap propriate number 1 0 1 to Y Sample Program 6 1 0 I N P U T ENTER...

Page 308: ...o COMMAND You can now execute MS DOS commands as allowed by COMMAND To return to BASIC use the MS DOS EXIT command SHELL sends the command information to COMMAND COM the MS DOS command processor If yo...

Page 309: ...D COM You can execute MS DOS commands such as D I R T I N E and then type EXIT to return to BASIC The following command uses redirection of input and output and the MS DOS SORT command SHELL S0RT data...

Page 310: ...To obtain the sine of number when number is in degrees use SIN number PI 180 where PI equals 3 141593 BASIC always returns the result as a single precision number unless you set the D switch when star...

Page 311: ...ticks Clock ticks occur 18 2 times per second The shortest sound is 1 and the longest is 65535 If duration is 0 BASIC turns off any currently running SOUND statement Otherwise BASIC completes the fir...

Page 312: ...the fre quency of the note s letter in the chart and divide that number by 2 For example the note A in the octave below middle C has a frequency of 440 00 To generate notes in the octave above middle...

Page 313: ...UND ON 1 0 I N P U T I N HONOR OF WHOM WAS THE CONTINENT OF AMERICA NAMED A 20 I F A AMERIGO VESPUCCI THEN SOUND 5 0 0 5 0 E L S E GOT0 4 0 3 0 P R I N T THAT S R I G H T END 4 0 SOUND 37 2 P R I N T...

Page 314: ...255 Example PR INT DESCR IP T I ON SPFICE 4 1 TYPE SPACE 9 1 Q U A N T I T Y prints DESCRIPTION 4 spaces TYPE 9 spaces QUANTITY Sample Program 9 2 0 P R I N T Here 9 3 0 P R I N T S P C E C 1 3 i5 9 4...

Page 315: ...kips number spaces in a PRINT statement Number is in the range 0 to 255 A semicolon is assumed to fol low the SPC number command You may use SPC only with PRINT LPRINT or PRINT See also SPACE Example...

Page 316: ...a single precision number unless you specified the D switch when starting up BASIC Example P R I N T S Q R 1 5 5 7 prints 12 47798 Sample Program 6 8 0 I N P U T TOTAL RESISTANCE OHMS R 690 I N P U T...

Page 317: ...k A returns the horizontal x coordinate for Joystick B returns the vertical y coordinate for Joystick B The coordinates returned by STICK l STICK 2 and STICK 3 are those previously read by STICK 0 Joy...

Page 318: ...can examine variables or change their values Use the CONT statement if you want to resume execution If the program itself has been altered during the break you cannot use CONT Unlike the END statement...

Page 319: ...ore the string While arithmetic operations may be performed on number only string functions and operations may be performed on the string The complementary function to STR is VAL Example converts the...

Page 320: ...lts in an Illegal function call error When you load BASIC the default is STRIG OFF and you cannot execute STRIG Function statements You cannot place a STRIG function in a subroutine that you branch to...

Page 321: ...ecuted BASIC returns a 1if it has been pressed and a 0 if not Tests to see if you are currently pressing Trigger Al BASIC returns a 1 if you are pressing it and a 0 if not Tests to see if Trigger B1 h...

Page 322: ...G function before you execute a STRIG ON BASIC issues an Illegal func tion call error See STRIG Trap You cannot place a STRIG function in a subroutine that you branch to as a result of an ON STRIGO GO...

Page 323: ...ment to see if you pressed a joystick button If you press a joystick button BASIC transfers program control to the line number specified in the ON STRIGO GOSUB statement See ON STRIGO GOSUB Note Do no...

Page 324: ...tion Therefore if you execute a STRIGO ON statement to enable joystick button trapping we recommend that you also execute a STRIGO OFF statement when you no longer need to check for joystick button ac...

Page 325: ...of the string specified STRING is useful for creating graphs or tables Examples B STRINGSC25 X puts a string of 25 X s into B PRINT STRING 50 10 prints 50 blank lines on the display because 10 is the...

Page 326: ...ts Either or both variables may be elements of arrays If one or both of the variables are non array variables that have not been assigned values an Illegal function call error results Example SWAP F 1...

Page 327: ...tatement SYSTEM Returns you to the MS DOS command level BASIC closes all files before returning to MS DOS Your resident BASIC program is not retained in memory Examples returns you to MS DOS Your resi...

Page 328: ...he current print position is already beyond space number TAB goes to that position on the next line You cannot use TAB to move the cursor to the left You cannot use TAB more than once in a print list...

Page 329: ...es use TAN number PI 180 where PI equals 3 141593 BASIC always returns the result as a single precision number unless you set the D switch when starting up BASIC Example prints 9 396959 P R I N T T A...

Page 330: ...e any number 0 through 59 If you omit the minutes minutes and seconds default to zero If you omit the seconds seconds default to zero Although you may omit leading zeros in each of the values you must...

Page 331: ...BASIC Keywords Examples TIMES 14 15 sets the current time to 14 15 00 TIMES 3 3 3 sets the current time to 03 03 03 FIS T I M E S assigns the current time to the variable A PRINT TIMES prints the curr...

Page 332: ...ght or since the last system reset BASIC always returns a single precision number You can use TIMER as the argument for the RANDOMIZE statement to reseed the random number generator See RAN DOMIZE for...

Page 333: ...e number specified The TIMER STOP statement temporarily halts timer trapping If the timer equals the specified number BASIC does not trans fer program control to the ON TIMERO GOSUB statement until yo...

Page 334: ...the program advances to a new line the tracer dis plays that line number inside a pair of brackets Sample Program 2 2 9 0 TRON 2 3 0 0 X X 3 1 4 1 5 9 2 3 1 0 TROFF Lines 2290 and 2310 assure you tha...

Page 335: ...call as many as 10 assembly language subroutines and then continue execution of your BASIC program Before you can execute a USR function call you must define the subroutine s address in a DEF SEG and...

Page 336: ...the first character that has no meaning in a numeric value If the string is nonnumeric or null VAL returns a zero Examples P R I N T VAL 1 0 0 DOLLARS prints 100 P R I N T V A L 1 2 3 4 E 5 prints 123...

Page 337: ...address of the disk buffer When used with direct access files VARPTR returns the address of the FIELD buffer If you specify a buffer that was not allocated when loading BASIC a Bad file number error o...

Page 338: ...string byte 0 type byte 1 low byte of address byte 2 high byte of address Type is 2 for integer variables 3 for string variables 4 for single precision variables and 8 for double precision variables N...

Page 339: ...or and Graphics for information on the 16 color set used for borders SCREEN specifies that all coordinates used in drawing are ab solute to Point 0 0 on the screen If you omit SCREEN all coor dinates...

Page 340: ...tatements without parame CLS clears only the active viewport Sample Program limits ters define the entire screen as the viewport 1 0 SCREEN 1 2 0 V I E W 1 0 1 0 2 0 0 1 0 0 2 3 0 PSET 1 0 0 5 0 4 0 D...

Page 341: ...range 1to 24 but must be less than bottom line If you omit top line BASIC assumes Line 1 as the beginning of the text viewport Bottom line specifies the last line of the text viewport It may be in th...

Page 342: ...th number2 if given If you omit number2 BASIC XORs the data with zero BASIC then ANDs the result with numberl If the re sult is zero BASIC starts again with reading the data at the port again If the r...

Page 343: ...ue BASIC repeats the process If it is not true exe cution resumes with the statement following the WEND statement You may nest WHILE WEND loops to any level Each WEND matches the most recent WHILE An...

Page 344: ...closed in quotation marks that speci fies on which device you want to set the width See Chapter 1for valid device names When you specify device BASIC stores the new width and does not change the curre...

Page 345: ...f you are using the VM 2 Monochrome Monitor or CM 2 Color Monitor If you are using the VM 2 Monochrome Monitor or the CM 2 Color Monitor you should note the following If you change the screen width BA...

Page 346: ...nter width to 132 The sec ond statement does not change the printer width until LPT1 is specified as the device in an OPEN statement 1 0 WIDTH LPRINT 80 100 OPEN LPT1 I FOR OUTPUT AS 1 150 PRINT 1 100...

Page 347: ...al coordinate The SCREEN option tells BASIC to set the coordinates like the screen display where the lesser y coordinate is in the upper left corner of the screen If you omit screen BASIC inverts the...

Page 348: ...orld coordinates If you give the command W I N D O W SCREEN 1 9 8 4 1 0 0 0 0 0 1 9 8 7 3 0 0 0 0 0 the coordinates can be pictured as follows for commands that use world coordinates Note RUN SCREEN a...

Page 349: ...tes data to the screen Data can be any string or numeric expression or variables If you omit data BASIC outputs a blank line The only difference between WRITE and PRINT is that WRITE prints commas bet...

Page 350: ...ou specify more than one data item separate the items with commas WRITE inserts commas between the data items it writes to disk It delimits strings with quotation marks Therefore it is not necessary t...

Page 351: ......

Page 352: ......

Page 353: ...llocation Outside BASIC s Work Area When you load BASIC the DS data segment register is set to the address of BASIC s work area To access an area of memory outside this work area execute a DEF SEG sta...

Page 354: ...need more stack space when you call an assembly lan guage subroutine you can save the BASIC stack and set up a new stack for the subroutine You must restore the BASIC stack before returning from the...

Page 355: ...the loop is complete the subroutine is in memory Whether you are using the USR function or the CALL statement to call the subroutine you must set the value of the subroutine entry point as the locatio...

Page 356: ...f you want to save the contents of the registers the first instructions in the subroutine must be a PUSH for each register and the last instructions in the subroutine must be a POP to re store the reg...

Page 357: ...l lowed by the offset CALLS pushes 4 bytes for each argument therefore the number in the RET statement RETn must be 4 times the number of arguments USR Function When the USR statement is executed the...

Page 358: ...gument is stored FAC is the exponent minus 128 and the binary point is to the left of the most significant bit of the mantissa FAC 1 contains the highest 7 bits of mantissa with leading 1 suppressed i...

Page 359: ...te 3 The contents of the variable are stored in the bytes im mediately following the vari able name The data can be 2 3 4 or 8 bytes in length depending on the type of data Data At least 3 bytes are r...

Page 360: ...ings if their lengths are modified by exter nal routines Since the string descriptor points to an area of memory in your BASIC program you must be careful not to alter or destroy your program To avoid...

Page 361: ...al use Disk File Control Block Refer to DOS User s Guide for contents Number of sectors read or written for sequential ac cess For random access it contains the last record number 1read or written Num...

Page 362: ...ransfer data between DOS and BASIC Use this offset to examine data in Sequential I O mode Variable length record size Default i s 128 Set by length option i n OPEN statement Current physical record nu...

Page 363: ...ou want to be able to close sequential input files open to the device driver This is used by the EOF statement Input Devices should return a Z CTRL q if BASIC attempts to read past the end of the devi...

Page 364: ...nguage routines before en tering BASIC Use Interrupt 27 to let the routines to exit MS DOS but still remain in memory For more information see the Programmer s Reference man ual for your computer It i...

Page 365: ......

Page 366: ......

Page 367: ...omatically enters the edit mode at the line that caused the error 3 RETURN without GOSUB BASIC executed a RETURN statement without pre viously executing a GOSUB statement 4 Out of DATA When executing...

Page 368: ...d execution continues without an error 7 Out of memory A program is too large has too many FOR loops or GOSUBs has too many variables or has expres sions that are too complicated 8 Undefined line numb...

Page 369: ...mmand was en tered at BASIC s prompt Type mismatch A string variable name was assigned a numeric value or vice versa A string function was given a numeric argument or vice versa Out of string space Th...

Page 370: ...ed Unprintable error An error message is not available for the error that occurred Missing operand BASIC encountered an expression that contained an operator but no operand Line buffer overflow The li...

Page 371: ...rror Messages Number Message 29 WHILE without WEND BASIC encountered a WHILE statement that did not have a matching WEND 30 WEND without WHILE BASIC executed a WEND statement before execut ing a WHILE...

Page 372: ...ed when BASIC was loaded File not found A LOAD KILL or OPEN statement references a file that does not exist on the current disk Bad file mode An attempt was made to use PUT GET or LOF with a sequentia...

Page 373: ...h a LOAD for example a filename with too many characters Direct statement in file Information in a non ASCII format was encountered while LOADing an ASCII format file The LOAD is terminated Too many f...

Page 374: ...over Disk media error Occurs when the FDC controller detects a hardware or media fault This usually indicates harmed me dia Copy any existing files to a new diskette and re format the damaged diskette...

Page 375: ......

Page 376: ......

Page 377: ...RE CSRLIN GET CSNG GOSUB CVD GOT0 CVI HEX cvs IF DATA IMP DATE INKEY DEF INP DEFDBL INPUT DEFINT INPUT DEFSNG INPUT DEFSTR INSTR DEFFN INT DEF USR INTER LINE PLAY LIST PMAP LLIST POINT LOAD POKE LOC P...

Page 378: ...NT INVERSE HYPERBOLIC SINE INVERSE HYPERBOLIC COSINE INVERSE HYPERBOLIC TANGENT BASIC Equivalent SEC X 1 COS X CSC X l SIN X COT X l TAN X ARCSIN X ATN X SQR X X 1 ARCCOS X ATN X SQR X X 1 1 5708 SQR...

Page 379: ...dix A Function BASIC Equivalent INVERSE HYPERBOLIC ARCSECH X LOG SQR SECANT HYPERBOLIC ARCCSCH X LOG SGN X x x 1 1 X SQR X X 1 l X INVERSE COSECANT HYPERBOLIC INVERSE COTANGENT ARCCOTH X LOG X l X 1 2...

Page 380: ......

Page 381: ...listed first ASCII Code The ASCII codes associated with the key The four modes are Normal The normal ASCII value returned when only the indicated key is depressed SHIFT The shifted ASCII value returne...

Page 382: ...CTRL Code Legend Normal ALT Remarks 01 ESC 1B 02 03 04 05 06 07 08 09 0A OB 0 c 0D BE 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1c 1D 1E 1F 20 21 22 1 2 3 4 5 6 7 8 9 0 1 BACK SPACE TAB Q W E R T Y U I...

Page 383: ...63 76 62 6E 6D 2 c 2E 2F 10 20 x3B x3c x3D x3E x3F x40 x41 x42 x43 x44 37 38 39 x50 34 35 36 x4D 31 32 33 30 2D 48 4A 4B 4 c 3A 22 x85 X87 5A 58 43 56 42 4E 4D 3 c 3E 3F 20 x54 x55 x56 x57 x58 x59 x5...

Page 384: ...rks 54 BREAK xOO xOO CTRLBREAK is the control brk routine INT 1BH ALT BREAK is the scroll lock bit toggle 55 INSERT 2B x52 x9F xA0 56 2E xAl xA4 xA5 Numeric keypad 57 ENTER 0D O D 0A x8F Numeric keypa...

Page 385: ...characters listed by doing either of the following 0 Using the BASIC statement PRINT CHR code where code is 0 Pressing and without releasing it typing the ASCII code For Codes 0 31 the table also lis...

Page 386: ...014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 null e V beep 13 tab line feed home form feed carriage return 1J 43 b 4 t ll 5 1 t J I t cursor right cursor left cursor up cur...

Page 387: ...047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 space 9 1 I 0 1 2 3 4 5 6 7 8 9 A E C 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 0...

Page 388: ...124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 h 140 I 141 j 142 k 143 I 144 m 145 n 146 0 147 P 148 q 149 r 150 S 151 t 152 U 153 v 154 W 155 X 156 Y 157 z 158 159 I 160 1 161 162 0...

Page 389: ...188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 3 212 2 213 i 214 I 215 i 216 I 217 i l 218 n 219 220 221 4 I1 222 J i l 223 3 224 1 1 225 I 226 7 227 L...

Page 390: ...Appendix B ASCII CHARACTER CODES ASCII ASCII Code Character Code Character 0 248 252 I 249 0 253 2 250 0 254 w 251 I f 255 blank FF 388...

Page 391: ...vided to help you quickly position the cursor for screen prints You ll find it espe cially useful for creating visually pleasing easy to follow screen menus See the CSRLIN and POS function for informa...

Page 392: ...390...

Page 393: ...usually the scan code of the key s pressed The key s and associated ASCII codes in decimal are listed below Second Key s Second Key Character Pressed Character Pressed 15 16 17 18 19 20 21 22 23 24 25...

Page 394: ...nd Key s Second KeyW Character Pressed Character Pressed 102 103 104 105 106 107 108 109 110 1 1 1 112 113 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 152 153 162 163 172 1...

Page 395: ...g 152 types 62 ASC Fn 92 98 ASCII codes 98 112 302 379 388 Aspect ratio 77 78 Assembly language subroutines 351 356 CALL 105 calling 105 DEFUSR 140 interfacing 351 353 loading 352 poking 353 USR 333 A...

Page 396: ...211 244 247 279 Buffer music 264 Buffer printer 213 Calling subroutines 105 140 CALLS St 87 106 355 CDBL Fn 92 107 Chaining 108 126 CHAIN St 108 126 CHOIR St 87 111 Child processes 306 307 361 362 CHR...

Page 397: ...precision 49 50 107 113 129 Converting strings 317 334 Coordinates 82 absolute 82 relative 82 physical 266 267 345 346 world 266 267 345 346 COS Fn 92 128 Cosine 128 CSNG Fn 92 129 CSRLIN Fn 92 130 C...

Page 398: ...376 377 Device errors 153 154 Device names 14 Devices 14 242 243 342 361 DIM St 63 87 142 Direct access 70 73 see also Disk files Directories 11 111 changing 111 creating 220 displaying 161 162 remov...

Page 399: ...end of file 150 EOF 150 INPUT 181 182 INPUT 183 184 LINE INPUT 203 locating records 207 OPEN 242 243 PRINT 276 278 PRINT USING 276 278 updating 69 70 Diskcopy 18 19 Display page 80 303 Division 52 int...

Page 400: ...ulate 157 trapping 156 157 228 EXP Fn 92 158 Exponent natural 158 Exponential numbers 48 Exponentiation 51 Expressions 51 175 Extensions 12 File control block 358 360 Filenames 12 13 Files see Disk fi...

Page 401: ...54 Inequality sign 52 INKEY Fn 93 177 INP Fn 93 178 250 252 253 254 255 256 279 282 284 303 304 337 338 IF THEN ELSE St 88 175 176 INPUT St 88 179 180 INPUT St 88 181 182 INPUT St 88 183 184 Input co...

Page 402: ...apping 192 193 232 233 KILL St 88 194 LCOPY 88 195 LEFT Fn 93 196 LEN Fn 93 197 Less Than sign 52 Less Than Equal To sign 53 LET St 88 198 Light pen trapping 234 260 LINE INPUT St 88 202 LINE INPUT St...

Page 403: ...read 258 Memory size 20 117 118 138 167 MID Fn 93 219 MID St 89 218 MKD Fn 93 221 MKDIR St 89 220 MKI Fn 93 221 MKS Fn 93 221 MOD 52 Modulus arithmetic 52 child processes 306 directory path 12 13 dire...

Page 404: ...89 228 293 ON GOTOSt 89 231 ON COM GOSUB St 89 124 226 227 ON GOSUB St 89 229 230 294 ON KEY GOSUB St 89 193 232 233 ON PEN GOSUB St 89 234 235 260 ON PLAY GOSUB St 89 236 237 265 ON STRIG GOSUB St 89...

Page 405: ...Fn 94 266 POINT Fn 94 267 POKE St 90 258 268 Ports 178 249 340 POS Fn 94 269 Position cursor 209 Precision conversion 49 50 107 113 129 PRESET St 90 279 PAINT St 90 250 252 PALETTE St 90 253 254 PALE...

Page 406: ...rdinates 82 REM St 90 288 Remarks 43 288 Removing directories 296 Removing files 195 Removing lines 141 Removing programs 223 Renaming files 222 Reserved words 375 RESET St 90 291 Resolution 77 78 RES...

Page 407: ...203 locating records 207 OPEN 242 243 PRINT 276 278 PRINT USING 276 278 Updating 69 70 Setting date 134 Setting time 328 SGN Fn 94 305 SIN Fn 94 308 Sine 308 Single precision 45 48 49 CSNG 129 CVS 13...

Page 408: ...94 326 TAN Fn 94 327 Tangent 327 TERM St 91 Terms 8 86 Text mode 80 123 303 304 339 Tiling 251 252 Time 328 329 330 setting 328 329 trapping 240 241 TIME Fn 94 328 329 TIMER Fn 94 285 330 TIMER TrapSt...

Page 409: ...o aspect ratio 77 78 Video clear 120 Video display worksheet 389 Video memory 79 80 117 118 257 Video pages 79 80 117 118 257 Video resolution 77 78 Viewports 337 338 VIEW PRINT St 91 339 WAIT St 91 3...

Page 410: ......

Page 411: ......

Reviews: