background image

Содержание 1000 MS-DOS

Страница 1: ......

Страница 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...

Страница 3: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 8: ......

Страница 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...

Страница 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...

Страница 11: ......

Страница 12: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 17: ......

Страница 18: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 27: ......

Страница 28: ......

Страница 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...

Страница 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...

Страница 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...

Страница 32: ......

Страница 33: ......

Страница 34: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 42: ......

Страница 43: ......

Страница 44: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 59: ......

Страница 60: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 66: ......

Страница 67: ......

Страница 68: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 77: ......

Страница 78: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 85: ......

Страница 86: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 97: ......

Страница 98: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 351: ......

Страница 352: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 365: ......

Страница 366: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 375: ......

Страница 376: ......

Страница 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...

Страница 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...

Страница 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...

Страница 380: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 392: ...390...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 410: ......

Страница 411: ......

Отзывы: