Home
COMMODORE BASIC 3.5 MANUAL
Contents
1. NUMBER 66 MESSAGE ILLEGAL TRACK AND SECTOR DESCRIPTION The DOS has attempted to access a track or block which does not exist in the format being used This may indicate a problem reading the pointer to the next block disk_error 67 ILLEGAL SYSTEM T OR S disk_error 67 ILLEGAL SYSTEM T OR S NUMBER 67 MESSAGE ILLEGAL SYSTEM T OR S DESCRIPTION This special error message indicates an illegal system track or sector disk _error 70_ NO CHANNEL disk_error 70_NO_ CHANNEL NUMBER 70 MESSAGE NO CHANNEL DESCRIPTION No channel available The requested channel is not available or all channels are in use A maximum of five sequential files may be opened at one time to the DOS Direct access channels may have six opened files disk error 71 DIRECTORY ERROR disk error 71 DIRECTORY ERROR NUMBER 71 MESSAGE DIRECTORY ERROR DESCRIPTION The BAM Block Availability Map does not match the internal count There is a problem in the BAM allocation or the BAM has been overwritten in DOS memory To correct this problem reinitialize the disk to restore the BAM in memory Some active files may be terminated by the corrective action disk error 72 DISK FULL disk error 72 DISK FULL NUMBER 72 MESSAGE DISK FULL 77 DESCRIPTION Either the blocks on the disk are used or the directory is at its entry limit DISK FULL is sent when two blocks are available on the 1541 to allow the current file to be closed
2. basic _error 31 CAN T RESUME basic _error 31 CAN T RESUM NUMBER 31 MESSAGE CAN T RESUME J ESCRIPTION A RESUME statement encountered without TRAP statement in effect basic_error 32_LOOP_NOT_FOUND basic_error 32_LOOP_NOT_FOUND NUMBER 32 71 MESSAGE LOOP NOT FOUND DESCRIPTION The program has encountered a DO statement and cannot find the corresponding LOOP basic _error 33 LOOP WITHOUT DO basic _error 33 LOOP WITHOUT DO NUMBER 33 MESSAGE LOOP WITHOUT DO DESCRIPTION LOOP encountered without a DO statement active basic_error 34 DIRECT MODE ONLY basic_error 34 DIRECT MODE ONLY NUMBER 34 MESSAGE DIRECT MODE ONLY DESCRIPTION This command is allowed only in direct mode not from a program basic _error 35 NO GRAPHICS AREA basic _error 35 NO GRAPHICS AREA NUMBER 35 MESSAGI NO GRAPHICS AREA Fa DESCRIPTION A command DRAW BOX etc to create graphics encountered before th GRAPHIC command was executed basic _error 36 BAD DISK basic _error 36 BAD DISK NUMBER 36 MESSAGE BAD DISK DESCRIPTION An attempt failed to HEADER a disk because the quick header method no ID was attempted on an unformatted disk or the disk is bad J AI A AR on nema DISK ERROR MESSAGES NOTES Error message numbers 02 19 35 38 40 49 53 59 and 68 69 should be ignored Message numb
3. NOTES None BUGS 46 sta NAM None None tement INPUT statement INPUT INPUT Asks input from the user and stores acquired data ABBREVIATION SYNOPSIS FUNCTION None INPUT lt prompt gt lt variable gt lt gt lt variable gt The INPUT statement allows the computer to ask for data from the person running the program and place it into a variable or variables The program stops prints a question mark on the screen and waits for the person to type the answer and press the lt return gt key The word INPUT is followed by a variable name lt variable gt or list of variable names separated by commas There may be a message inside quotes before the list of variables to be input lt prompt gt If this message called a prompt is present there must be a semicolon after the closing quote of the prompt When more than one variable is to be INPUT they should be separated by commas when typed in If not the computer asks for the remaining values by printing two question marks If you press lt return gt key without INPUTting values the INPUT variables retain the values previously held for those variables INPUTS lt prompt gt prompt string lt variable gt acquired data will be stored in this variable RESULT Asks input from the user and stores acquired data in the target variable s EXAMPLES 10 INPUT WHAT S YOUR NAME
4. disk error 73 DOS MISMATCH disk error 73 DOS MISMATCH NUMBER 73 MESSAGI DOS MISMATCH pa DESCRIPTION DOS 1 and 2 are read compatible but not write compatible Disks may be interchangeably read with either DOS but a disk formatted on one version cannot be written upon with the other version because the format is different This error is displayed whenever an attempt is made to write upon a disk which has been formatted in a non compatible format A utility routine is available to assist in converting from one format to another This message may also appear after power up NOTES Error number 73 in CBM DOS V2 6 1541 disk error 74 DRIVE NOT READY disk error 74 DRIVE NOT READY NUMBER 74 MESSAGE DRIVE NOT READY DESCRIPTION An attempt has been made to access the Floppy Disk Drive without any disk present eA A a Ro nena BASIC ABBREVIATIONS m o obtain Basic keywords without having to type the whole command press the letter s on the left and then shift key and the letter on the right The shifted character appears as a graphics character but when the line is listed the abbreviation will be expanded out into the full word The abbreviation for a keyword is generally the first letter of the keyword and the second letter shifted but this may vary Keyword First letter s Shifted Letter ABS A R ASC A S ATN A
5. NOTES None BUGS None None function INT function INT NAME INT Extracts the integer portion of a decimal number ABBREVIATION None SYNOPSIS INT lt number gt FUNCTION Returns the integer portion of lt number gt with all decimal places to the right of the decimal point removed The result is always less than or equal to lt number gt Thus any negative numbers with decimal places become the integer less than their current value e g INT 4 5 5 INPUTS lt number gt number to b valuated RESULT Integer part of a given number numeric EXAMPLES X INT X 100 5 100 Rounds to the next highest penny NOTES If the INT function is to be used for rounding off the form is INT lt number gt 5 or INT lt number gt 5 BUGS None None function JOY function JOY NAME JOY Polls joystick port 21 ABBR SYNO FUNC INPU RESU EVIATION j lt shift gt O PSIS JOY lt port gt TION This function returns the state of joystick connected to port lt port gt Any value returned of 128 or more means the fire button is also depressed The direction is indicated as follows UP FIRE 1 128 8 2 LEFT 7 0 3 RIGHT 6 4 5 DOWN TS lt port gt joystick port number 1 2 LT State of joystick numeric EXAMPLES 100 J JOY 2 If value of 13
6. a The syntax of items are described by using the following concepts KEYWORDS appear in upper case letters You must type keywords exactly as they appear ARGUMENTS appear within angle brackets Arguments are parts that you select SQUARE BRACKETS show optional arguments You select any or none of the arguments listed VERTICAL BAR separates lists of options from which you can choose only one A SEQUENCE OF THREE DOTS means that an option or argument can be repeated more than once QUOTATION MARKS enclose character strings file names and other expressions When arguments ar nclosed in quotation marks in a format you must include the quotation marks in your command function or statement Quotation marks are required parts of a command function or statement PARENTHESES When arguments ar nclosed in parentheses ina format you must include the parentheses in your command function or Statement COMMANDS AUTO BACKUP COLLECT CONT COPY DELETE DIRECTORY DLOAD DSAVE HEADER HELP KEY LIST LOAD NEW RENAME RENUMBER RUN SAVE SCRATCH VERIFY command AUTO command AUTO NAME AUTO Controls the automatic line numbering ABBREVIATION a lt shift gt U SYNOPSIS AUTO lt line gt FUNCTION Turns on the automatic line numbering feature which eases the job of entering prog
7. EXT WITHOUT FOR basic _error 11_ SYNTAX ERROR UMBER ia ESSAGE SYNTAX ERROR ESCRIPTION A statement is unrecognizable by BASIC or extra parenthesis basic _error 12 RETURN WITHOUT _GOSUB NUMBE URN WITHOUT GOSUB RIPTION A RETURN statement ncountered when no basic_error 13_OUT_OF_DATA NUMBER 13 ESSAGE OUT OF DATA iw ESCRIPTION A READ statement ncountered basic _error 14 ILLEGAL QUANTITY NUMBER 14 xJ ESSAGI ILL EGAL QUANTITY J ESCRIPTION A number used as the argument of a function or statement is outside t allowable range basic_error 15_O0OVERFLOW NUMBI ER 5 ESSAGE 15 OV ERFLOW ESCRIPTION The result of a com 1 701411833E 38 basic_error 16_OUT_OF_ MEMORY NUMBER 16 MESSAGE OUT OF MEMORY DESCRIPTION Either t are too many DO FOR basic _error 17 UNDEF D STATEMENT NUMBER Lf MESSAGE UNDEF D STATEMENT DESCRIPTION A line number referenced does not basic _error 18 BAD SUBSCRIPT misspelled keyword here is no more room for program and program variables or GOSUB statements in effect This could be because of missing etc basic _error 12 RETURN WITHOUT _GOSUB GOSUB statement was active basic_error 13_OUT_OF_DATA without data left unREAD b
8. None function STRS function STRS NAME STRS Converts number into a string ABBREVIATION st lt shift gt R 29 SYNOPSIS STRS lt number gt FUNCTION This function converts a decimal number into a string INPUTS RESULT lt number gt number to be converted A string corresponding a given numeric value string EXAMPLES NOT 10 A 10 5 20 PRINT A 30 AS STRS A 40 PRINT AS 10 5 10 5 ES E None BUGS None function TAB function TAB NAM F E TAB Sets cursor s x position ABBREVIATION t lt shift gt A SYNOPSIS TAB lt column gt FUNCTION EXA This function is used in the PRINT statement The next item to b printed is in column number lt column gt UTS lt column gt cursor s x position 0 39 ULT Sets cursor to the given column within the PRINT statement PLES None NOT function TAN function TAN NAM F E TAN Returns tangent value ABBREVIATION None SYNOPSIS TAN lt angle gt FUNCTION This function gives the tangent of lt angle gt where lt angle gt is an angle in radians INPUTS lt angle gt angle in radians RESULT 30 Tangent value of an angle numeric EXAMPLES None NOTES None BUGS None function USR function USR NAME USR Executes a machine language program with a param
9. enclosing the number of the variable in the list Examples A 7 BZ S 11 AS 87 Arrays may have more than one dimension A two dimensional array may be viewed as having rows and columns with the first number identifying the column and the second number in the parentheses identifying the row as if specifying a certain grid on a map Examples A 7 2 BZS 2 3 4 A 3 2 RESERVED VARIABLE NAMES There are seven variable names which are reserved for use by the computer and may not be used for another purpose These are th variables variable DS variable DS NAME DS Disk drive s status DESCRIPTION EXAI The variable DS reads the disk drive command channel and returns the current status of the drive DS is used after a disk operation like DLOAD or DSAVE to find out why the red error light on the disk drive is blinking PLES NOTES None variable DSs variable DS 65 NAME DS Disk drive s status in words DESCRIPTION EXA current status of the drive in words the red error light on the disk drive is blinking PLES NAME EXA NOTES None 7 Last error line IPTION he line number where last error occurred PLES variable NAME NOTES None Gl a ER Last error line DESCRIPTION EXA the last error error condition
10. statement READ statement READ NAME ABBREVIATION SYNOPSIS r lt shift gt E READ Get information from DATA statements READ lt variable gt lt gt lt variable gt 56 FUNCTION a variables may contain reading str produces an INPUTS EXA RESULT lt variable gt Data read f lt variable gt PLES 10 READ A NOTES None BUGS statement R NAME E None ea ES REM Atta ABBREVIATION None SYNOPSIS REM lt messa FUNCTION The REMark It may expl author etc program ex word REM ma gives stran INPUTS EXA lt message gt Attach a no This statement is used to get information from DATA statements into where the data can be used The READ statement variable list both strings and numbers Care must be taken to avoid ings where the READ statement expects a number which ERROR message read data will be stored in this variable rom the DATA statements is stored in the target variables jS G Y ea Ss statement R ches a note to the source cod ge gt is just a note to whoever is reading a LIST of the program ain a section of the program give information about the REM statements in no way effect the operation of the cept to add to its length and therefore slow it down The y be followed by any text although
11. COMMODORE BASIC 3 5 MANUAL version 2 2d by Janne Peraaho amp Anders Persson Copyright 1 Introduction 1 Manual Format 2 Commands 3 Functions L5 Operators 32 Statements 33 Variables 64 Basic Error Messages 67 Disk Error Messages 72 Basic Abbreviations 78 Petascii codes 80 Musical Note Table 83 Authors 84 Related Documents 84 References 84 COPYRIGHT Commodore BASIC version 3 5 Copyright 1984 Commodore Electronics Limited Commodore BASIC version 3 5 Copyright 1977 Microsoft Commodore 16 K ytt j n opas Copyright PET COMMODORE INC Oy PCI Data Ab Commodore 16 User Manual Copyright 1984 Commodore Electronics Limited Commodore 64 K ytt j n opas Copyright 1985 PET COMMODORE INC Oy PCI Data Ab Kaikki kuusnelosesta 3 painos Copyright 1983 Robert J Brady Company Kaikki kuusnelosesta 3 painos Copyright 1985 Amer yhtyma Oy AMERSOFT INTRODUCTION Basic is a high level language which is based on the following six concepts commands statements functions variables operators and expressions Commands and statements are instructions to the computer to perform a certain task for example an instruction to load a basic program into memory The difference between them is that Basic commands are intended to be used in direct mode while statements should be used in programs However in most cases commands can be used
12. EXIT LOOP UNTIL lt bool_arg gt WHILE lt bool_ arg gt FUNCTION Performs the statements between the DO statement and the LOOP statement If no UNTIL or WHILE modifies either the DO or the LOOP statement execution of the intervening statements continues indefinitely If an EXIT statement is encountered in the body of a DO loop execution is transferred to the first statement following the LOOP statement DO loops may be nested following the rules defined for FOR NEXT loops If the UNTIL parameter is used the program continues looping until the 39 boolean argument is satisfied becomes TRUE The WHILE parameter is basically the opposite of the UNTIL parameter the program continues looping as long as the boolean argument is TRU B INPUTS lt bool_arg gt boolean argument For example A 1 or H gt 57 lt statements gt statements to be executed RESULT EXAMPLES DO WHILE A GETA LOOP NOTES None BUGS None Performs the statements between the DO statement and the LOOP statement forever or until WHILE or UNTIL condition is satisfied statement DRAW statement DRAW NAME DRAW Draws dots lines and shapes ABBREVIATION d lt shift gt R SYNOPSIS DRAW lt color_ src gt lt x gt lt y gt TO lt x gt lt y gt lt gt lt x gt lt y gt FUNCTION INPUTS lt color src gt d
13. disk _error 39 SYNTAX ERROR command sent to command channel secondary T disk_error 50_ RECORD_NOT_ PRESENT the last record through INPUT or GET also occur after positioning to a record If the intent is to expand the with a PRINT command th rror messag should not be attempted after this error is disk_error 51_OVERFLOW_IN RECORD 75 NUMBER MESSAGE OVERFLOW IN RECORD DESCRIPTION PRINT statement exceeds record boundary Information is truncated Since the carriage return which is sent as a record terminator is counted in the record size this message will occur if the total characters in the record including the final carriage return exceeds the defined siz disk_error 52_ FILE TOO LARGE disk_error 52_FILE TOO LARGE T NUMBER 52 ral MESSAGI FILE TOO LARG oo DESCRIPTION Record position within a relative file indicates that disk overflow will result disk error 60 WRITE FILE OPEN disk error 60 WRITE FILE OPEN NUMBER 60 MESSAGE WRITE FILE OPEN iw ESCRIPTION This message is generated when a write file that has not been closed is being opened for reading disk error 61 FILE NOT OPEN disk error 61 FILE NOT OPEN NUMBER 61 aa MESSAGI FILE NOT OPEN J ESCRIPTION This message is generated
14. 3 14159265 numeric PLES NOT None function ABS function ABS NAM F E ABS Returns the magnitude of the numeric value ABBREVIATION a lt shift gt B SYNOPSIS ABS lt number gt FUNCTION EXA a The absolute value function returns the magnitude of the argument lt number gt UTS lt number gt numeric value ULT Magnitude of the given number numeric PLES NOT None None function ASC function ASC NAM 16 ASC Returns character s ASCII code ABBREVIATION a lt shift gt S SYNOPSIS ASC lt string gt FUNCTION This function returns the ASCII code number of the first character of lt string gt INPUTS lt string gt string RESULT ASCII code number of the first character of the given string numeric EXAMPLES None NOTES function ATN function ATN NAME ATN Returns arctangent ABBREVIATION a lt shift gt T SYNOPSIS ATN lt number gt FUNCTION Returns the angle whose tangent is lt number gt measured in radians INPUTS lt number gt tangent number RESULT Angle measured in radians numeric EXAMPLES None NOTES None function CHRS function CHRS NAME CHR Returns a character in the base of ASCII code ABBREVIATION c lt shift gt H SYNOPSIS CHRS lt ascii_code gt FUN
15. AS 20 INPUT AND YOUR FAVOURITE COLOR BS 30 INPUT WHAT S THE AIR SPEED OF A SWALLOW A NOTES This statement can only be executed within a program BUGS None statement INPUT statement INPUT NAME INPUT Reads data from a file or a device ABBREVIATION SYNOPSIS i lt shift gt N INPUT lt file gt lt variable gt lt gt lt variable gt FUNCTION This works like INPUT but takes the data from a previously OPENed file or device No prompt string is allowed INPUTS lt file gt file device number to be read lt variable gt acquired data will be stored in this variable RESULT EXA Reads data from the file device and stores acquired data in the target variable s PLES NOT 0 INPUT 2 A C D S This statement can only be executed within a program 47 BUGS None statement LET statement LET NAME ET Sets a value to a variable ABBREVIATION 1 lt shift gt E SYNOPSIS ET lt variable gt lt expression gt FUNCTION The word LET is hardly ever used in programs since it is not necessary but the statement itself is the heart of all BASIC programs Whenever a variable is defined or given a value LET is always implied The variable name which is to get the result of a calculation is on the left side of the equal sign and the number or formula is on the right side INPUTS lt
16. HI 17x M 490 velow 158 P F180 Me 191 Codes 192 223 are same as 96 127 Codes 224 254 are same as 160 190 Code 255 is the same as code 126 Code 5 appears between quotes as code 69 but reversed Code 28 appear between quotes as code 92 but reversed Codes 30 31 appear between quotes as codes 94 95 but reversed Code 129 appears between quotes as code 97 but reversed Code 144 appears between quotes as code 112 but reversed Codes 149 156 appear between quotes as codes 117 124 but reversed Codes 158 159 appear between quotes as codes 126 127 but reversed Examples print chr 130 this is blinking print chr 14 everything is lo case 82 MUSICAL NOTE TABLE The table below contains the sound register values of six octaves of notes for PAL and NTSC television standards in To use the first not in the tabl The sound register values A sound regis as a second number after the SOUND command SOUND 1 7 30 ter valu NOTE REGISTER PAL REGISTER NTSC FREQUENCY HZ A 7 7 10 0 A 64 64 16 6 H 118 118 23 5 C 169 169 130 9 C 217 217 138 6 D 262 262 146 9 D 305 305 155 6 E 345 345 164 9 F 383 383 174 7 F 419 419 185 0 G 453 453 196 0 G 485 485 207 7 A 516 516 220 0 A 544 544 23361 H 571 571 247 0 C 596 597 261 7 C 620 621 QT E2 D 643 643 2 93 57 D 664 665 3112 E 685 685 3
17. NEW Erases BASIC program in memory ABBREVIATION None SYNOPSIS NEW FUNCTION This command erases th ntire program in memory and clears out any variables that may have been used Unless the program was stored somewhere it is lost until you type it in again Be careful when you use this command he NEW command can also be used as a statement in a BASIC program When your computer gets to this line the program is erased and everything stops This is not especially useful under normal circumstances m INPUTS None RESULT BASIC program is erased from memory and all variables are cleared out EXAMPLES NEW NOTES None BUGS None 11 command RENAME command RENAME NAME RENAME Renames a file ABBREVIATION SYNOPSIS FUNCTION re lt shift gt N RENAME D lt drive gt lt old_ filename gt TO lt new_filename gt U lt unit gt Used to rename a file on a disk INPUTS lt drive gt drive number lt old_ filename gt original file name lt new_filename gt new file nam lt unit gt drive unit number RESULT EXA Renamed file PLES RENAME D0 ASSET TO LIABILITY Changes the name of the file from ASSET to LIABILITY NOTES BUGS None None None command RENUMBER command RENUMBER NAME RENUMBER Renumbers prog
18. T AUTO A U BACKUP B A BOX B O CHAR CH A CHR Cc H CIRCLE C I CLOSE Ch O CLR G CMD G M COLLECT COL L COLOR CO L CONT C O COPY CO P COS none DATA D A DEC none DEF FN D E DELETE DE L DIM D I DIRECTORY DI R DLOAD D L 78 DO none DRAW D R DSAVE D S END E N ERRS E R EXP E X FOR F O FRE F R GET G E GET none GETKEY GETK E GOSUB GO S GOTO G O GRAPHIC G R GSHAPE G S HEADER HE A HELP HE L HEXS H E IF none INPUT none INPUT I N INSTR IN S INT none JOY J O KE K E EFTS E F EN none LIST L I LOAD L O OCATE 10 C LOG none LOOP LO O IDS I ONITOR O NE none NEXT N E ON GOSUB ON GO S ON GOTO ON G O OPEN O P PAINT P A PEEK P E POKE P O POS none PRINT PRINT USING US I PRINT P R PUDE P U RCLR R G RDOT R D READ R E REM none RENAME RE N RENUMBER REN U RESTORE RE S RESUME RES U RETURN R T RGR R G RIGHTS R I RLUM R L RND R N RUN R U SAVE S A SCALE SC A SCNCLR S Cc SCRATCH S5C R SGN S G SIN S I SOUND S O SPC S P SQR S Q SSHAPE S S STOP S T 79 STRS ST R SYS S Y AB T A AN none RAP T R ROFF RO F RON R O UNTIL U N USR U S VAL none VERIFY V E VOL V O WAIT W A WHILE W H PETASCIIL CODES PRINTS CHR PRINTS CHR PRINTS CHR PRINTS CHR 0 16 E sz s x 1 17 33 1 49 2 BA 18 3
19. The Commodore 16 have 2 independent sound channels and ability to produce square and white noise timbres as follows Voice Sound channel Wave shape 1 1 square 2 2 square 3 2 noise If a SOUND for voice n is requested and the previous SOUND for the same n is still playing BASIC waits for the previous SOUND to complete SOUND with a duration of 0 is a special case It causes BASIC to turn off the current SOUND for that voice immediately regardless of the time remaining on the previous SOUND INPUTS lt voice gt voice number 1 3 lt frq_control gt sound register value 0 1023 lt duration gt duration of a sound in 60ths of a second 0 65535 RESULT Cuts off or produces a sound with square or white noise timbr EXAMPLES SOUND 2 800 3600 Plays a note using voice 2 with frequency set at 800 for one minute NOTES The sound register value lt frq_control gt does not correspond directly to the real sound frequency If you want to produce a sound with a certain frequency use the following formulas to find the sound register value for the desired frequency formula for computers using PAL television standard SOUND REGISTER VALUE 1024 111840 45 FREQUENCY formula for computers using NTSC television standard SOUND REGISTER VALUE 1024 111860 781 FREQUENCY BUGS None statement SSHAPE statement SSHAPE NAME SSHAPE Sa
20. bring lines to the screen for modification INPUTS lt first_line gt first BASIC line to be shown lt last_line gt last BASIC line to be shown RESULT Brings BASIC program lines to the screen EXAMPLES NOT BUG LIST Shows entire program LIST 100 Shows from line 100 until the end of the program LIST 10 Shows only line 10 LIST 100 Shows lines from the beginning until line 100 LIST 10 200 Shows lines from 10 to 200 inclusive ES None S None None command LOAD command LOAD NAM F E LOAD Loads a program from storage device into a memory ABBREVIATION 1 lt shift gt O SYNOPSIS FUNCTION LOAD lt file gt lt device gt lt rel_flag gt a This is the command to use when you want to use a program stored on tape or on disk If you type just LOAD and hit the lt return gt key the computer screen goes blank Press play and the computer starts looking for a program on the tape When it finds one the computer prints FOUND lt filename gt You can hit the C key Commodore key to LOAD if you don t press the key the computer resumes searching on the tape after a brief interval Once the program is LOADed you can RUN LIST or change it You can also type the word LOAD followed by a program name which is most often a name in quotes lt program_name gt The name may be followed by a comma outside
21. containing the error is displayed in flashing characters PLES NOT HELP None command KEY command KEY NAM KEY Assigns a string into a function key ABBREVIATION k lt shift gt E SYNOPSIS KEY lt key gt lt string gt FUNCTION m here are eight 8 function keys available to the user on your Commodore 16 computer four unshifted and four shifted Your Commodore 16 allows you to define what each key does when pressed KEY without any parameter specified gives a listing displaying all the current KEY assignments The data you assign to a key is typed out when that function key is pressed The maximum length for all the definitions together is 128 characters Entire commands or a series of commands can be assigned to a key INPUTS lt key gt function key number 1 8 lt string gt string to be assigned into a key Shows current function key bindings or assigns a string into a function key EXAMPLES NOT ES E BUGS None KEY 7 GRAPHICSO CHRS 13 LIST CHR 13 Causes the computer to select text mode and list your program whenever the F7 key is pressed in direct mode The CHR 13 is the ASCII character for lt return gt Use CHRS 34 to incorporate a double quote into a KEY string The keys may be redefined in a program For Example 10 KEY2 TESTING
22. data block This error message indicates that there is an error in one or more of the data types The data has been read into the DOS memory but the checksum over the data is in error This message may also indicate grounding problems disk error 24 READ ERROR disk error 24 READ ERROR NUMBER 24 MESSAGE READ ERROR DESCRIPTION Byte decoding error The data or header has been read into the DOS memory but a hardware error has been created due to an invalid bit pattern in the data byte This message may also indicate grounding problems disk error 25 WRITE ERROR disk error 25 WRITE ERROR NUMBER 25 MESSAGE WRITE ERROR DESCRIPTION Write verify error This message is generated if the controller detects a mismatch between the written data and the data in the DOS memory ECT ON disk error 26 WRITE PROTECT ON disk error 26 WRITE PROT 73 NUMBER 26 MESSAGE WRITE PROTECT ON DESCRIPTION This message is generated when the controller has been requested to write a data block while the write protect switch is depressed Typically this is caused by using a disk with a write protect tab over the notch disk error 27 READ ERROR disk error 27 READ ERROR NUMBER 27 MESSAGE READ ERROR DESCRIPTION Checksum error in header The controller has detected an error in the header of the requested data block The block has not been
23. gt variable which holds the loop counter value lt start_val gt start value for loop variable lt end_val gt end value for loop variable lt increment gt RESULT Performs the statements betw until the loop variable reaches th nd value EXAMPLES 10 FOR L 1 TO 20 20 PRINT L 30 NEXT L 40 PRINT BLACKJACK L L Prints the numbers from one to twenty ob the screen message BLACKJACK L 21 10 FOR L 1 TO 100 20 FOR A 5 TO 11 STEP 2 30 NEXT A 40 NEXT L FOR NEXT loop with loop variable A is nested inside th NOTES STEP increment default value is 1 A STEP value can be positive or ne gative 41 BUG sta NAM ABB SYN FUN You can set up loops inside one another This is known as nesting loops You must be careful to nest loops so that the last loop to start is the first one to end S None tement GET statement GET m E GET Gets data from the keyboard REVIATION g lt shift gt E OPSIS GET lt variable gt CTION The GET statement is a way to get data from the keyboard one character at a time When the GET is executed the character that was typed is received If no character was typed then a null empty character is returned and the program continues without waiting for a key There is no need to press the lt return gt key and in fact the lt return gt key can be received with a GET The word GET is followed by a variable name usually a string variable
24. read into the DOS memory This message may also indicate grounding problems disk error 28 WRITE ERROR disk error 28 WRITE ERROR NUMBER 28 MESSAGE WRITE ERROR DESCRIPTION Too long data block The controller attempts to detect the sync mark of the next header after writing a data block If the sync mark does not appear within a pre determined time th rror message is generated Th rror is caused by a bad disk format the data extends into the next block or by hardware failure disk error 29 DISK _ID MISMATCH disk error 29 DISK ID MISMATCH NUMBER 29 MESSAGE DISK ID MISMATCH DESCRIPTION This message is generated when the controller has been requested to access a disk which has not been initialized The message can also occur if a disk has a bad header disk error 30 SYNTAX ERROR disk error 30 SYNTAX ERROR NUMBER 30 MESSAGE SYNTAX ERROR DESCRIPTION Error in general syntax a The DOS cannot interpret the command sent to the command channel Typically this is caused by an illegal number of file names or patterns are illegally used For example two file names may appear on the left side of the COPY command p disk_error 31_SYNTAX_ERROR disk_error 31_ SYNTAX ERROR NUMBER 31 be MESSAGI 74 iw SYNTAX ESCRIPTION Invalid command ERROR The DOS does not recogn
25. screen left gt lt top gt lt string gt lt reverse flag gt trings can be displayed on any screen at a given command Character data is read from the computer You supply the left lt left gt and top lt top gt tarting position and the text string lt string gt you or lt color gt and reverse imaging lt reverse flag gt ued on the next line if it attempts to print past screen When Used in TEXT mode the string printed right edge of th the CHAR command eld cursors flas tring do not work w PD PHIC mode INPUTS lt color_ src gt lt left gt lt top gt lt string gt lt reverse flag gt pri cha cha tex rev works just like a PRINT string including reverse h on off etc These control functions inside the hen the CHAR command is used to display text in nting color source 0 3 racter column 0 39 racter row 0 24 t to be printed erse field flag O off l on 34 Pixel Cursor location nding arc angle Any rotation position statement CIRCLI GI triangle or an octagon ellipse arc triangle or is on the RESULT Prints given string on a screen at a given EXAMPLES CHAR 1 10 10 HELLO NOTES None BUGS None statement CIRCLE NAME CIRCLE Draws a circle ellipse arc ABBREVIATION ec lt shift gt I SYNOPSIS CIRCLE lt color_ src gt lt x gt lt y gt lt x_radius gt lt y
26. sure it contains no programs you wish to keep INPUTS lt src_drive gt source drive number lt trg_drive gt target drive number lt unit gt target drive unit number RESULT EXAMPLES The contents of the source disk is copied to the target disk NOT BACKUP DO TO D1 Copies all files from the disk in drive 0 to the disk in drive 1 BACKUP DO TO D1 ON U9 Copies all files from drive 0 to drive 1 in disk drive unit 9 ES E This command can only be used with dual disk drive BUGS command COLLECT command COLLECT NAM m E COLLECT Deletes references to improperly closed files ABBREVIATION col lt shift gt L SYNOPSIS FUNCTION INPUTS EXA COLLECT D lt drive gt ON U lt unit gt Use this command to free up space allocated to improperly closed files and deletes references to these files from the directory lt drive gt target drive number lt unit gt target drive unit number ULT Frees up disk space allocated to improperly closed files PLES NOT COLLECT DO ES E None BUGS None None command CONT command CONT NAM CONT Re start the execution of a program that has been stopped ABBREVIATION c lt shift gt O SYNOPSIS CONT FUNCTION This command is used to re start the execution of a program that has been stopped by either using the S
27. the function Following the name is a set of parentheses with a numeric variable lt variable gt enclosed Then you have an equal sign followed by the formula lt expression gt you want to define You can call the formula substituting any number for a variable lt variable gt INPUTS lt fnc_name gt name of the function lt variable gt variable name used in the formula lt expression gt formula RESULT Defines a function to be used within a program EXAMPLES 10 DEF FNA X 12 34 75 X 3 X 20 PRINT FNA 7 The number 7 is inserted each place X is located in the formula given in the DEF statement NOTE S DEF FN can only be used with standard numeric functions not integer or string functions BUGS None None 38 statement DIM statement DIM NAME DIM Presents and reserves memory for an array ABBREVIATION d lt shift gt I SYNOPSIS DIM lt variable gt lt subscripts gt lt variable gt lt subscripts gt lt gt lt variable gt lt subscripts gt FUNCTION Before you can use an array of variables the program must first execute a DIM statement to establish the DIMensions of that array unless there are 11 or fewer elements in the array The statement DIM is followed by the name of the array lt variable gt which may be any legal variable name Then nclosed in parentheses you put the number or numeric variable of e
28. to the start reaches a line with the command lt increment gt to the value of t is higher than the end of loop for a set EX v N nN diat EXT value END statement T loop alue executed is the statement imm the loop variable is larger t statement executed is the one nan or variable This allows you way necessary ST with the NEXT statemen number of times number so t hing counted such as printing is the variable that is added to or E are the beginning and ending coun is as follows lt start_val gt When it adds the STEP increment loop variable and checks If it is no ly following t the end of loop number following the NEXT The end loop value may be followed by the word STEP and anot to count backwards statement FOR EP lt increment gt t to set up a section of the You may just want your he program pauses for a few or something must be done a he start value lt start_val gt ts for the loop variable the program First o see if it he next lin ement If n th xt t higher he FOR sta th statement n her number by fractions or any lt loop_var gt lt loop_var gt value to be added to or subtracted from loop variable n the FOR statement and the NEXT statement followed by the larger on INPUTS lt loop_var
29. use of graphic characters ge results any text te to the source code so it can be read from the program 10 NEXT X REM THIS LINE IS UNNECESSARY NOTES None BUGS None statement RESTORE statement RESTORE NAME RESTORE Sets a DATA pointer ABBREVIATION SYNOPSIS RESTORE lt l FUNCTION W which is to g lt line gt fo re lt shift gt S ine gt hen executed in a program the pointer to the item in a DATA statement be read next is reset to the first item in the list This ives you the ability to re READ the information If a line number llows the RESTORE statement the pointer is set to that line program Otherwise the pointer is reset to the first DATA statement in the 57 EXA UTS lt line gt a BASIC line number where DATA pointer should be set ULT Sets DATA pointer to the first item in a DATA item list or to the given BASIC line number which contains a DATA statement PLES NOT BUG sta NAM ABB SYN FUN 10 RESTORE 200 ES None S None il tement RESUME statement RESUM m E RESUME Continues program execution after an error REVIATION res lt shift gt U OPSIS RESUME lt line gt NEXT CTION Used to return to execution after TRAPping an error With no arguments RESUM
30. variable gt name of the target variable lt expression gt number or formula to be stored in variable lt variable gt RESULT Given value is stored to the given variable EXAMPLES 10 LET A 5 20 B 6 30 C A Bt 3 40 DS HELLO ET is implied but not necessary in lines 20 30 and 40 NOTES None BUGS None None statement LOCATE statement LOCATE NAME XOCATE Changes pixel cursor position ABBREVIATION lo lt shift gt C SYNOPSIS LOCATE lt x gt lt y gt FUNCTION The LOCATE command lets you put the pixel cursor PC anywhere on the screen The PC is the current location of the starting point of the next drawing Unlike the regular cursor you can t see the PC but you can move it with the LOCATE command You can find out where the PC is at any time by using the RDOT 0 function to get the x coordinate and RDOT 1 to get the y coordinate The color source of the dot at the PC can be found by printing RDOT 2 In all drawing commands where a color option is available you may select a value from 0 to 3 corresponding to the background foreground multicolor 1 or multicolor 2 as the color source INPUTS lt x gt scaled x coordinate lt y gt scaled y coordinate RESULT Puts the pixel cursor at the given position EXAMPLES KOCATE 160 100 Positions the PC in the center of the high resolution screen 4
31. want it and you can store the next program without fear of erasing an old one VERIFY without anything after the command causes the computer to check the next program on tape regardless of its name against the program now in memory VERIFY followed by a program name in quotes or a string variable searches the tape for that program and then checks its VERIFY Followed by a name and a comma and a number checks the program on the device with that number The relocate flag lt rel_flag gt is the same as in the LOAD command tj Q INPUTS lt file gt file name and or pattern to be checked lt device gt storage device number lt rel_flag gt relocate flag 0 or 1 RESULT Verification EXAMPLES VERIFY Checks the next program on the tape VERIFY REALITY Searches for REALITY on tape checks against memory VERIFY ME 8 1 Searches for ME on disk then checks NOTES Device 1 tape Device 8 disk BUGS None FUNCTIONS oD HHMOSZ2Z2Hhaa a TOOZARAHX h a jH O W U HOGQO0 Ot D I DDI E Z iw 15 fun NAM SGN SIN SPC ction function F E q Returns the value of pi ABBREVIATION None SYNOPSIS lt dummy gt FUNCTION EXA fa The pi symbol when used in an equation has the value 3 14159265 UTS lt dummy gt dummy argument and can be any value ULT
32. 2987 F 704 704 349 3 F 722 722 370 0 G 139 739 392 0 G 755 755 415 4 A 770 770 440 0 A 784 784 466 2 H 798 798 493 9 C 810 810 5233 C 822 822 554 4 D 834 834 587 4 D 844 844 622 3 E 854 854 659 3 F 864 864 698 5 F 873 873 740 0 G 881 881 784 0 G 889 889 830 7 A 897 897 880 0 A 904 904 932 4 H 911 911 987 8 C 917 O17 046 6 923 923 108 8 D 929 929 174 7 D 934 934 244 6 E 939 939 318 6 F 944 944 397 0 F 948 948 480 0 G 953 953 568 0 G 957 957 661 3 A 960 960 760 0 A 964 964 864 7 H 967 967 975 6 C 971 971 2093 0 C 974 974 2217 5 D 976 976 2349 4 D 979 979 2489 1 E 982 982 2637 1 F 984 984 27939 F 986 986 2960 0 G 988 988 3136 0 G 990 990 3322749 A 992 992 3520 0 A 994 994 372973 H 996 996 39541 83 7 us th 7 AUTHORS Janne Perdaho E mail amity surfeu fi Anders Persson http listen to bora ALL DOCUMENTS This document is part of a document package intended for Plus 4 C16 and C116 users The documents included are basic35 pdf This document Janne s original manual more or less short35 pdf A basic quick guide advanced pdf The Hardware and Advanced Basic programming tedmon pdf A short description of the built in machine language monitor REFERENCES Commodore 16 Kayttajan opas Commodore 16 User Manual Commodore 64 Kayttajan opas Kaikki kuusnelosesta 3 painos Commodore Vic 20 Swedish User Manual Commodore plus 4 and cl6 memory map 84
33. 3 MESSAGE STRING TOO LONG J ESCRIPTION A string can contain up to 255 characters basic _error 24 FILE DATA basic _error 24 FILE DATA NUMBER 24 ae MESSAGI FILE DATA iw ESCRIPTION Bad data read from a tape basic _error 25 FORMULA TOO COMPLEX basic _error 25 FORMULA TOO COMPLEX 70 NUMBER 25 MESSAGE FORMULA TOO COMPLEX DESCRIPTION Simplify the expression break into two parts or use fewer parentheses GI ESI basic_error 26_CAN T_CONTINU basic_error 26_CAN T_CONTINU NUMBER 26 MESSAGE CAN T CONTINU Fl J ESCRIPTION The CONT command does not work if the program was not RUN there was an error or a line has been edited basic_error 27_UNDEF D_ FUNCTION basic_error 27_ UNDEF D FUNCTION NUMBER 27 MESSAGE UNDEF D FUNCTION DESCRIPTION A user defined function referenced that was never defined basic _error 28 VERIFY basic _error 28 VERIFY NUMBER MESSAGE VERIFY DESCRIPTION The program on tape or disk does not match the program in memory basic _error 29 LOAD basic _error 29 LOAD NUMBER 29 MESSAGE LOAD DESCRIPTION There was a problem loading Try again T basic_error 30_BREAK basic_error 30_BREAK NUMBER 30 MESSAGE BREAK iw ESCRIPTION The stop key was hit to halt program execution a
34. 4 2 50 Stop 3 HOME 19 35 3 51 4 gp 20 36 4 52 White 5 21 37 5 53 6 22 amp 38 6 54 7 23 39 7 55 Disable Shift 8 24 40 8 56 Enable Shift 9 25 41 9 57 10 26 42 58 11 ESC 27 43 59 12 Red 28 44 lt 60 nB l 45 61 LoCase 14 Green 30 i 46 gt 62 15 Blue 31 47 63 80 PRINTS CHRS PRINTS CHR A 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 U V imi J d 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 PRINTS CHR 81 MAIO lt LI MUOINVCIISI4 5 O n gt L Hat 106 107 108 109 110 111 112 113 114 115 111 Ti 118 119 120 te 122 123 124 125 126 PRINTS CHR x 127 128 Orange 129 Flash On 130 Shift run stop 131 Flash Off 132 f1 f3 f5 f7 f6 138 134 135 136 137 138 139 140 EB e cs UCase 142 Black tT 143 144 145 146 147 PRINTS CHR PRINTS CHR PRINTS CHR PRINTS CHR 148 cyan 159 J oif 181 Brown 149 E co fF ivi e Lt Green 150 Jf 1651 g 172 183 Pink 151 pl 162 H 173 PM 184 Green 152 163 H 174 m 185 Lt Bue 153 164 LJ 175 186 Dp Pur 154 165 H 176 g 187 Lt Green 155 Be 166 IO 177 M188 Purpe 156 167 H3 178 H 189 157 wm 1688
35. 5 returned joystick in port 2 has turned to left with fire button NOTES None BUGS None None function LEFT function LEFTS NAME EFTS Strips string from the right ABBREVIATION le lt shift gt F SYNOPSIS EFTS lt string gt lt length gt FUNCTION This function returns a string containing the leftmost lt length gt characters of string lt string gt INPUTS lt string gt source string lt length gt number of characters to be included in result string RESULT String containing leftmost lt length gt characters of the string lt string gt EXAMPLES None NOTES None BUGS None function LEN function LEN 22 NAME EN Returns the number of characters in the string ABBREVIATION None SYNOPSIS EN lt string gt FUNCTION This function returns the number of characters including spaces and other symbols in the string lt string gt INPUTS lt string gt string to be evaluated RESULT Number of characters numeric EXAMPLES NOTES None function LOG function LOG NAME LOG Returns the natural log of the given number ABBREVIATION None SYNOPSIS LOG lt number gt FUNCTION This function returns the natural log of lt number gt The natural log is log to the base e INPUTS lt number gt number to b valuated RESULT Natural log of the given number EXAMPLES None NOTES To convert to log bas
36. 8 NOT BUG sta NAM ABB SYN FUN ES None S None tement MONITOR statement MONITOR m E MONITOR Starts machine language monitor REVIATION m lt shift gt O OPSIS MONITOR CTION This command takes you out of BASIC into the build in machine language monitor program The monitor is used to develop debug and execute machine language programs more easily than from BASIC INPUTS None RESULT Starts machine language monitor EXAMPLES MONITOR NOTES When in the monitor typing an X and pressing lt return gt gets you back to BASIC Also read the tedmon pdf document for a description of all the monitor commands BUG sta NAM ABB S None tement NEXT statement NEXT T m E NEXT Completes a FOR loop REVIATION n lt shift gt E SYNOPSIS NEXT lt variable gt lt gt lt variable gt FUNCTION INPUTS e The NEXT statement is used with the FOR statement When the computer encounters a NEXT statement it goes back to the corresponding FOR statement and check the loop variable If the loop is finished execution proceeds with the statement after the NEXT statement The word NEXT may be followed by a variable name a list of variable names s t eparated by commas or no variable names If there are no names listed he last loop started is the one being completed If the variable
37. A PEEK 2034 7 For further communication you can of course also poke and peek to memory locations that you design your ML routine to use UTS lt address gt memory address 0 65535 ULT Begins executing a machine language program from the given memory location PLES NOT BUG sta NAM None ES None S None tement TRAP statement TRAP m E TRAP Turns on or off error interception ABBREVIATION t lt shift gt R SYNOPSIS TRAP lt line gt FUNCTION When turned on TRAP intercepts all error conditions including the lt run stop gt key except UNDEF D STATEMENT ERROR In the event of any execution error the error flag is set and execution is transferred to the line number named in the TRAP statement lt line gt The line number in which the error occurred can be found by using the system variable EL The string function ERR ER gives th rror message corresponding to any error condition ER TRAP with no line number argument turns off error TRAPping UTS lt line gt BASIC line number where program execution should continue when an error occurs ULT When line number has been given turns on error interception otherwise turns it off EXAMPLES 200 TRAP 210 210 PRINT AN ERROR OCCURED IN LINE EL STOP NOTES An error in a TRAP routine cannot
38. BBREVIATION b lt shift gt O SYNOPSIS BOX lt color src gt lt left gt lt top gt lt right gt lt bottom gt lt angle gt lt fill_ flag gt FUNCTION This command allows you to draw a rectangle of any size anywhere on th screen To get the default value include a comma without entering a value Rotation is based on the center of the rectangl The Pixel Cursor PC executed INPUTS lt color_src gt lt left gt lt top gt lt right gt lt bottom gt lt angle gt lt fill_flag gt scaled scaled scaled scaled ESULT Draws a rectangle 1 EXAMPLES BOX 1 10 10 60 60 draw color source box rotation in clockwise degrees fill flag 0 or 1 is left at lt right gt lt bottom gt after the BOX statement is 0 3 default is 1 corner coordinate corner coordinate corner coordinate corner coordinate foreground color default is 0 degrees default is 0 no filling Draws the outline of a rectangle BOX 10 10 60 60 45 Draws a filled BOX 30 90 45 1 Draws a filled NOTES None BUGS None statement CHAR F E CHAR Prints strin NAM ABBREVIATION ch lt shift gt A SYNOPSIS CHAR lt color_src gt lt FUNCTION Text alphanumeric s Location by the CHAR haracter ROM area oordinates of the s t to display col optional string is contin 1 rotated box a diamond rotated polygon statement CHAR g on a
39. CHRS 34 KEY3 NO To define function keys as they are on the Commodore 64 and VIC 20 10 FOR I 1 TO 8 KEY I CHRS 1I 132 NEXT To restore all function keys to their default values reset your Commodore 16 by turning it off and on or press the RESET button None command LIST command LIST NAME LIST Lets you look at lines of a BASIC program ABBREVIATION 1 lt shift gt I SYNOPSIS LIST lt first_line gt lt last_line gt FUNCTION a The LIST command lets you look at lines of a BASIC program that have been typed or LOADed into the computer s memory When LIST is used alone without any numbers following it you get a complete LISTing of the program on your screen which may be slowed down by holding the C key Commodore key paused by lt ctrl gt S unpaused by pressing any other key or STOPped by pressing the lt run stop gt key If you follow the word LIST with a line number your computer only shows that line number If you type LIST with two numbers separated by a dash the computer shows all lines from the first to the second line number If you type LIST followed by a number and just a dash it shows all the lines from that number to the end of the program And if you type LIST a dash and then a number you get all the lines from the beginning of the program to that line number Using these variations you can examine any portion of a program or easily
40. CTION This function returns a string character whose ASCII code is lt ascii_code gt INPUTS lt ascii_code gt character s ASCII code 0 255 RESULT 17 EXA Character corresponding the given ASCII code PLES PRINT CHRS 65 CHRS 66 CHRS 67 ABC NOT ES E None BUGS None function Cos NAM F E COS Returns cosine value ABBREVIATION None SYNOPSIS COS lt angle gt FUNCTION EXA string measured in radians UTS lt angle gt angle in radians ULT Cosine value of an angle numeric PLES function DI NOT None 5al Q NAME DEC Converts hexadecimal number to decimal ABBREVIATION None SYNOPSIS DEC lt string gt FUNCTION EXA Returns decimal value of hexadecimal string UTS lt string gt hexadecimal string 0000 FFFF ULT Decimal value of the given hexadecimal number x BUG fun NOT ES EC F4 S None S None None ction ERR 18 Returns the value of the cosine of lt angle gt wher numeric function cCos lt angle gt is an angle t Q function DI function ERRS NAME ERR Returns string describing error condition ABBREVIATION e lt shift gt R SYNOPSIS ERRS lt err_ condition gt FUNCTION This function returns string describing given error conditi
41. E attempts to re execute the line in which the error occurred RESUME NEXT resumes execution at the next statement following the statement containing the error RESUME lt line gt will GOTO the specific line and begin execution there INPUTS EXA lt line gt a BASIC line number where program execution should continue NEXT resume execution at the next statement ULT Resumes execution after an error at the line where th rror occurred or at the next BASIC line or at a given BASIC line NOT BUG sta NAM PLES None ES E None S None tement RETURN statement RETURN m E RETURN Returns from a subroutine ABBREVIATION re lt shift gt T SYNOPSIS RETURN FUNCTION 5 at his statement is always used with the GOSUB statement When the program encounters a RETURN statement it goes to the statement immediately following the last GOSUB command executed If no GOSUB was previously issued then a RETURN WITHOUT GOSUB ERROR message is delivered and program execution is stopped INPUTS None RESULT Returns from a subroutine to the statement following the last subroutine call GOSUB statement 58 EXAMPLES None NOTES None BUGS None statement SCALE NAME T SCALE Controls bit maps scaling ABBREVIATION sc lt shift gt A
42. I NUMBE 6 R MESSAGE NOT INPUT FILI Fl iw ESCRIPTION isk basic_error 05 DEVICE NOT PRESENT The required I O device not available basic_error 06_NOT_INPUT_FIL I An attempt made to GET or INPUT data from a file that was specified as output only basic _error 07 NOT OUTPUT FILI NUMBE 7 R MESSAGE NOT OUTPUT FILI GI iw ESCRIPTION Fl jes basic _error 07 NOT OUTPUT FIL An attempt made to send data to a file that was specified as input only basic_error 08 MISSING FILE NAME NUMBE 8 R MESSAGE MISSING FILE Fi NAM J ESCRIPTION An OPEN LOAD or SAVE basic _error 09 ILLEGAL DEVICE NUMBER NUMBE 9 R aail MESSAGI ILLEGAL DEVICE NUMBER iw ESCRIPTION An attempt made to us a devic basic_error 10_ NEXT WITHOUT FOR NUMBER NEXT WITHOUT FOR TION A RIP Eit NEXT basic_error 11_SYNTAX_ERROR her loops are nested incorrectly statement that does not correspond with one in a FOR b asic_error 08 MISSING FILE NAM jes to the disk generally requires a file name basic error 09 ILLEGAL DEVICE NUMBER improperly 68 SAVE basic _error 10_N to the screen etc or there is a variable name ina
43. INPUTS lt line gt line number where subroutine begins RESULT Program execution continues in a given subroutine lt line gt until RETURN statement is encountered EXAMPLES 20 GOSUB 800 800 PRINT HI THERE RETURN Line 20 means go to the subroutine beginning at line 800 and execute it NOTES 43 None None tement GOTO statement GOTO GOTO Redirects program execution ABBREVIATION g lt shift gt O SYNOPSIS GOTO lt line gt GO TO lt line gt FUNCTION After a GOTO or GO TO statement is executed the next line to b executed will be the one with the line number following the word GOTO When used in direct mode GOTO lt line gt allows you to start execution of the program at the given line number without clearing the variables INPUTS ESULT EXAMPLES lt line gt line number where program execution should continue Program execution continues at the given line 10 PRINT REPETITION IS THE MOTHER OF LEARNING 20 GOTO 10 The GOTO in line 20 causes line 10 to be run continuously until the lt run stop gt key is pressed ES None None tement GRAPHIC statement GRAPHIC GRAPHIC Changes graphic mode ABBREVIATION SYNOPSIS g lt shift gt R GRAPHIC lt mode gt lt clr_flag gt CLR FUNCTION 1 a This statement puts your computer in one of its 5 graphic mo
44. INT USING 1 Result 1 0 Trailing zero added 10 PRINT USING 100 5 Result 104 Rounded to no decimal places 10 PRINT USING 1000 Result KKKK Overflow because four digits and minus sign cannot fit in field 10 PRINT USING 10 Result 10 Decimal point added 10 PRINT USING S 1 Result 1 Leading sign NOTES None BUGS None statement PRINT statement PRINT NAME PRINT Writes data to a file or a device ABBREVIATION p lt shift gt R SYNOPSIS PRINT lt file gt lt printlist gt FUNCTION There are a few differences between this statement and the PRINT First of all the word PRINT is followed by a number which refers to the device or data file previously OPENed The number is followed by a comma and a list of things to be PRINTed The semicolon acts in the same manner for spacing as it does in the PRINT statement The comma will send 10 spaces to most printers and can be used as a separator for disk files INPUTS lt file gt logical number of target file devic lt printlist gt items to be printed RESULT Writes given data lt printlist gt to the target file devic 55 EXAMPLES NOTES 100 PRINT 1 HELLO THERE AS BS Some devices may not work with TAB and SPC BUGS None statement PUDEF statement PUDEF NAME PUDEF ABBREVIATION Redefines PR
45. INT USING symbols p lt shift gt U SYNOPSIS PUDEF lt definition gt FUNCTION PUDEF lets you redefine up to 4 symbols in the PRINT USING statement You can change blanks commas decimals points and dollar signs into some other character by placing the new character in the correct position Position in the PUDEF control string 1 is the filler character The default is a blank Place a new character here when you want another character to appear in place of blanks Position Position Position INPUTS 2 is the comma character Default is a comma 3 is the decimal point 4 is the dollar sign lt definition gt definition string for symbols from left to right RESULT EXAMPLES 10 PUDEF Prin 20 PUDEF Prin 30 PUDEF Prin 40 PUDEF Prin the first character defines a filler character the second character defines a comma the third character defines a decimal point and the fourth character defines a dollar sign Redefines four PRINT USIGN symbols a filler character a comma a decimal point and a dollar sign UES ts in the place of blanks amp Ww ts amp in the place of commas v7 ts decimal points in the place of commas and commas in the place of decimal points E ts English pound sign in the place of decimal points in the place of commas and commas in place of decimal points NOTES None BUGS None
46. If a numeric ware used and any key other than a number was hit the program would stop with an error message The GET statement may also be put into a loop checking for an empty result which waits for a key to be struck to continue The GETKEY statement could also be used in this case UTS lt variable gt acquired data will be stored in this variable ULT Data acquired from the keyboard is stored in the target variable lt variable gt EXAMPLES 10 GET AS IF AS lt gt A THEN 10 This line waits for the A key to be pressed to continue NOTES BUG sta NAM This command can only be executed within a program S None tement GET statement GET T m E GET Gets data from a file or a device ABBREVIATION None SYNOPSIS GET lt file gt lt variable gt FUNCTION Used with a previously OPENed device or file to input one character at a time Otherwise it works like the GET statement UTS lt file gt file device number to be read lt variable gt acquired data will be stored in this variable ULT Data acquired from the file device is stored in the target variable lt variable gt EXAMPLES 10 GET 1 A NOTES 42 This command can only be executed within a program BUGS None statement GETKEY statement GETKEY NAME GETKEY Gets data from
47. N sc lt shift gt R SYNOPSIS SCRATCH lt file gt D lt drive gt U lt unit gt FUNCTION Deletes a file from the disk directory As a precaution you are asked Are you sure before your computer completes the operation Type a Y to perform the SCRATCH or type N to cancel the operation Use this command to erase unwanted files to create more space on the disk INPUTS lt file gt file name and or pattern to be deleted lt drive gt drive number lt unit gt drive unit number RESULT File is erased from the disk directory EXAMPLES SCRATCH MY BACK D1 Erases the file MY BACK from the disk in drive 1 NOTES None BUGS None command VERIFY command VERIFY NAME VERIFY Checks stored program against the one in memory ABBREVIATION v lt shift gt E SYNOPSIS VERIFY lt file gt lt device gt lt rel_flag gt FUNCTION 14 This command causes your computer to check the program on tape or disk against the one in memory This is proof that the program you just SAV is really saved to make sure that nothing went wrong This command is also very useful to position a tape so that your computer resumes writing following the end of the last program on the tape All you do is tell the computer to VERIFY the name of the last program on the tape It will do so and tell you that the programs don t match which you already knew Now the tape is where you
48. SYNOPSIS SCALE lt scaling_flag gt FUNCTION The be changed with the SCALE SCALE 1 turns scaling on both x and y rather command than the normal MUltLEGOLOr Modet iiaae x high resolution mode x SCALE 0 turns scaling off INPUTS lt scaling flag gt scaling mode RESULT Turns scaling on or off EXAMPLE SCAL TI hb NOTES None BUGS None None statement SCNCLR NAME SCNCLR Clears the screen ABBREVIATION s lt shift gt C SYNOPSIS SCNCLR FUNCTION Clears th screen current screen whether graphics INPUTS None RESULT Clears the current screen EXAMPLE SCNCLR NOTES None 59 0 to 319 y O no scaling statement SCALE scaling of the bit maps in multicolor and high resolution modes can Entering Coordinates may then be scaled from 0 to 1023 in scale values which are 0 to 159 y 0 to 199 0 to 199 l scale statement SCNCLR text or both split BUGS None statement SOUND statement SOUND NAME SOUND Produces a sound ABBREVIATION s lt shift gt O SYNOPSIS SOUND lt voice gt lt frq_control gt lt duration gt FUNCTION This statement produces a SOUND using one of the thr voices lt voice gt with a frequency control lt frq_control gt in the range of 0 1023 for a duration lt duration gt of 0 65535 60ths of a second
49. TOP statement or an END statement within the program INPUTS None RESULT The program will resume execution where it left off EXAMPLES CONT NOTES CONT will not work if you have changed or added lines of the program or even just moved the cursor to a program line and hit lt return gt without changing anything if the program stopped due to an error or if you caused an error before trying to re start the program BUGS None command COPY command COPY NAME COPY Copies a file ABBREVIATION co lt shift gt P SYNOPSIS COPY D lt src_drive gt lt src_ file gt TO D lt trg_drive gt lt trg_ file gt ON U lt unit gt FUNCTION Copies a file on the disk in one drive the source file to the disk in the other on dual disk drive only or creates a copy of a file on the same drive with a different file name INPUTS lt src_drive gt source drive number lt src_file gt source file name lt trg_drive gt target drive number lt trg_ file gt target file name lt unit gt target drive unit number RESULT A copy of a file is created EXAMPLES COPY DO NOON TO D1 NIGHT Copies NOON from drive 0 to drive 1 renaming it NIGHT COPY DO STUFF TO D1 STUFEF Copies STUFF from drive 0 to drive 1 COPY DO TO D1 Copies all files from drive 0 to drive 1 COPY CATS TO DOGS Copies CATS as a program called DOGS on the same d
50. This function gives the contents of memory location lt address gt INPUTS lt address gt memory location 0 65535 RESULT Contents of the memory location numeric EXAMPLES PEEK 1024 5 NOTES None BUGS None where lt address gt is located in the range of 0 to 65535 returning a result from 0 to 255 This is often used in conjunction with the POKE statement function POS function POS NAME POS Current cursor x position ABBREVIATION None SYNOPSIS POS lt dummy gt 24 FUNCTION This function returns the number of the column 0 39 where the next PRINT statement begins on the screen INPUTS lt dummy gt dummy argument and can be any value RESULT Cursor x position numeric EXAMPLES None NOTES None function RCLR function RCLR NAME RCLR Returns color source s current color ABBREVIATION r lt shift gt C SYNOPSIS RCLR lt color _src gt FUNCTION This function returns current color assigned to source lt color src gt INPUTS lt color src gt color source 0 4 0 background 1 foreground 2 multicolor 1 3 multicolor 2 4 border RESULT Returns current color 1 15 for colors 1 15 and 0 for color 16 EXAMPLES None NOTES None BUGS Returns 0 for color 16 It should return 16 function RDOT function RDOT NAME RDOT Returns information about the curr
51. _radius gt lt s_angle gt lt e_angle gt lt rotation gt lt degrees gt FUNCTION With the CIRCLE command you can draw a circle an octagon The final coordinate circumference of the circle at th lt rotation gt is about the center Arcs are lt s_angle gt clockwise to the ending angl drawn from the starting angle Th gt lt e_angl segment increment lt degrees gt controls the coarseness of the shape with lower values for inc creating rounder shapes INPUTS lt color src gt draw color source 0 3 lt x gt scaled center x coordinate defaults to Pixel Cursor PC lt y gt scaled center y coordinate defaults to Pixel Cursor PC lt x_radius gt scaled x radius lt y_radius gt scaled y radius defaults to lt x_radius gt lt s_angle gt starting arc angle default 0 lt e_angle gt ending arc angle default 360 lt rotation gt rotation in clockwise degrees default is 0 degrees lt degrees gt degrees between segments default is 2 degrees RESULT Draws a circle ellipse arc triangle or an octagon EXAMPLES CIRCLE 160 100 65 10 Draws an ellipse CIRCLE 160 100 65 50 Draws an oval CIRCLE 60 40 20 18 45 Draws an octagon CIRCLE 260 40 20 90 Draws a diamond CIRCLE 60 140 20 18 120 Draws a triangle NOTES None BUGS None statement CLOSE statement CLOSE NAME CLOSE Closes an
52. a numeric value lt line gt line number where program execution should continue LT Program execution continues at the line chosen from the line number list according to a value determined by a BASIC expression lt expression gt EXAMPLES NOTE BUGS stat NAME 10 INPUT X IF X lt 0 THEN 10 20 ON X GOTO 50 30 30 70 25 PRINT FELL THROUGH GOTO 10 30 PRINT TOO HIGH GOTO 10 50 PRINT TOO LOW GOTO 10 70 END When X 1 ON sends control to the first line number in the list 50 When X 2 ON sends control to the second line 30 etc S None None Gl ement OPI statement OPI zal A OPEN Opens a logical file for I O operations ABBREVIATION o lt shift gt P SYNOPSIS OPEN lt file gt lt device gt lt address gt lt command gt lt type gt lt mode gt FUNCTION 3 The OPEN statement allows your computer to access devices such as the ape and disk for data a printer or even the screen The word OPEN is ollowed by a logical file number lt file gt which is the number to which ll other BASIC statements will refer This number is from 1 to 255 here is normally a second number after the first called the device number lt device gt Device number 0 is the keyboard 1 is the tape default 3 is the screen 4 is the printer 8 is usually the disk A zero 0 may be included in front of the device number digit e g 08 for 8 Fol
53. as statements in a program if you prefix them with a line number You can also use several statements as commands by using them in direct mode i e without line numbers A function performs a simple task based on a given arguments and it always replies with a value a result Operators are used for calculations for determining equalities inequalities and for logical operations For example is an operator used for addition Expressions are clauses composed of constants variables and or operators For example A B 3 is a valid expression This manual s purpose is to provide detail information about presented Basic elements I hope you find it useful MANUAL FORMAT The Commodore BASIC 3 5 manual is divided into seven sections Commands the commands used for working with programs to edit store and erase them Functions the string numeric and print functions Operators the arithmetic and logical operators Statements the BASIC program statements used in numbered lines of programs Variables the different types of variables and legal variable names Basic errors th rror messages given by BASIC Disk errors th rror messages given by a disk drive store and erase them The items presented in sections follow consistent format conventions to make them as clear as possible In most cases there are several examples to illustrate what the actual command function or statement looks like
54. asic _error 14 ILLEGAL QUANTITY Ne basic _error 15 OVERFLOW putation is larger than the largest number allowed basic _error 16 OUT _OF MEMORY or there T M ENT basic_error 17_UNDEF D STATE xist in the program basic _error 18 BAD SUBSCRIPT 69 NUMBER 18 MESSAGE BAD SUBSCRIPT J ESCRIPTION The program tried to reference an element of an array out of the range specified by the DIM statement basic_error 19 REDIM D ARRAY basic _error 19 REDIM D ARRAY NUMBER 19 MESSAGE REDIM D ARRAY DESCRIPTION An array can only be DIMensioned once If an array is referenced befor hat array is DIM d an automatic DIM to 10 is performed ct basic _error 20 DIVISION BY ZERO basic _error 20 DIVISION BY ZERO T T NUMBER 20 MESSAGE DIVISION BY zZ Gl RO DESCRIPTION Division by zero is not allowed basic _error 21 ILLEGAL DIRECT basic _error 21 ILLEGAL DIRECT NUMBER 21 af MESSAGI ILLEGAL DIRECT iw ESCRIPTION INPUT or GET n tatements are only allowed within a program basic _error 22 TYPE MISMATCH basic _error 22 TYPE MISMATCH NUMBER 22 MESSAGE TYPE MISMATCH DESCRIPTION This occurs when a number is used in place of a string or vice versa basic _error 23 STRING TOO LONG basic _error 23 STRING TOO LONG NUMBER 2
55. asic memory The position of the bitmap is however the same Luminance data 6144 Color data 7168 and Graphics screen data 8192 This should mean that the area 4097 6143 is unused on the Plus 4 while using GRAPHIC BUGS None statement GSHAPE statement GSHAPE NAME GSHAPE Displays a shape on a graphic screen ABBREVIATION g lt shift gt S SYNOPSIS FUNCTION GSHAPE lt shape gt lt x gt lt y gt lt mode gt A rectangular graphic clips can be displayed on a multicolor or high resolution graphics screen by the GSHAPE statement If you type GSHAP with the shape variable lt shape gt the shape will be drawn with the top left of the shape positioned at the pixel cursor The shape variable may be followed by a graphic coordinates lt x gt and lt y gt and a replacement mode value lt mode gt The coordinates tell where the shape should be drawn on the screen and the mode value how it should be drawn There are five possible replacement mode values Fl Mode Description 0 place shape as is default 1 place field inverted shape 2 OR shape with area 3 AND shape with area 4 XOR shape with area In mode 0 the shape is drawn to the graphic screen as it is In this mode shape overwrites completely the graphic area where it is drawn In mode 1 the shape overwrites the graphic area just like in mode 0 but this time the overwriting shape is inverted In mode 2 logical operatio
56. be followed by any combinations of these items which is considered the printlist lt printlist gt Characters inside of quotes text lines Variable names A B AS X Functions SIN 23 ABS 33 Punctuation marks n The characters inside of quotes are often called literals because they are printed exactly as they appear Variable names have the value they contain either a number or a string printed Functions also have their number values printed Punctuation marks are used to help format the data neatly on the screen The comma divides the screen into 52 four columns for data while the semicolon doesn t add any spaces Either mark can be used as the last symbol in the statement This results in the next PRINT statement acting as if it is continuing the last PRINT statement INPUTS lt printlist gt items to be printed RESULT Given printlist is displayed on the screen EXAMPLES 10 PRINT HELLO 20 AS THERE PRINT HELLO AS 30 A 4 B 2 PRINT A B 50 J 41 PRINT J PRINT J 1 60 C A B D A B PRINT A B C D Result HELLO HELLO THERE 7 7 1 40 2 6 2 Bo NOTES None BUGS None statement PRINT statement PRINT NAME PRINT USING Formats and writes data to the screen file or devic ABBREVIATION Pus lt shift gt I SYNOPSIS PRINT lt file gt USING lt formatlist gt lt printlist gt FUNCTION These
57. be trapped The RESUME statement can be used to resum xecution BUGS None 62 statement TROFF NAME TROFF Turns trace mode off ABBREVIATION tro lt shift gt F SYNOPSIS TROFF FUNCTION a INPUTS None RESULT xits trace mode t EXAMPLES NOTES statement TRON NAME TRON Turns trace mode on ABBREVIATION tr lt shift gt O SYNOPSIS TRON FUNCTION of that statement is printed INPUTS None RESULT Begins the trace mode EXAMPLES None NOTES None BUGS None statement VOL NAME VOL Sets sound volume level ABBREVIATION v lt shift gt O SYNOPSIS VOL lt volume gt FUNCTION 0 to where 8 is maximum volume INPUTS This statement turns trace mode off statement TROFF statement TRON TRON is used in program debugging This statement begins trace mode When you are in trace mode as each statement xecutes the line number statement VOL Sets the current VOLume level for SOUND commands VOLume may be set from and 0 is off VOL affects all channels lt volume gt sound volume 0 8 RESULT Sets sound volume level EXAMPLES 10 VOL 8 Sets sound volume level to the maximum NOTES None BUGS None statement WAIT statement WAIT NAME WAIT Waits for a change of memory address ABBREVIATION w lt shift gt A SYNOPSIS WAIT lt address gt
58. des Mode Description 0 normal text 1 high resolution graphics 2 high resolution graphics split screen 3 multicolor graphics 4 multicolor graphics split screen When executed GRAPHIC mode 1 2 3 or 4 allocates a 10 12kb area for the bitmap leaving less room left for the basic program and variables If 1 is given in the GRAPHIC statement as the second argument the screen is also cleared The bitmap remains allocated in memory even if the user returns to TEXT mode GRAPHIC 0 until a GRAPHIC CLR is used INPUTS lt mode gt graphic mode 0 4 lt clr flag gt screen clear flag 0 off 1 on or CLR Deallocates the bit mapped memory area and makes it available once again for basic code and variables 44 RESULT Changes graphic mode and clears screen if clear flag is on EXAMPLES NOT GRAPHIC 1 1 Selects hi res graphic mode and clears the screen GRAPHIC 4 Selects multicolor graphics with an area for text without clearing the screen GRAPHIC CLR Deallocates the bitmap moves back the basic memory and returns to text mode ES E The way the bitmap is allocated differs depending on how much memory your machine has On a Plus 4 the whole basic memory is moved forward from 4097 to 16385 taking 12kb from the basic memory On a 16kb C16 the start position of the basic memory remains intact while the end of it is moved back from 16374 to 6144 taking 10kb from the b
59. e 10 divide by LOG 10 BUGS None function MIDS function MIDS NAME MIDS Returns a sub string ABBREVIATION m lt shift gt I SYNOPSIS MIDS lt string gt lt start_pos gt lt length gt FUNCTION This function returns a string containing lt length gt characters starting from the lt start_pos gt character in string lt string gt MIDS can also be used on the left side of assignment statement as a pseudo variable as well as a function 23 An error results if lt start_pos gt lt length gt is greater than the length of the source string lt string gt INPUTS lt string gt source string lt start_pos gt starting position of the sub string lt length gt length of the sub string to b xtracted or length of the target area lt string gt at the given position lt start_pos gt EXAMPLES Using MIDS as a pseudo variable 10 AS THE LAST GOODBYE 20 PRINT AS 30 MIDS AS 6 3 ONG 40 PRINT AS THE LAST GOODBYE THE LONG GOODBYE Using MIDS for extracting sub string 10 PRINT MIDS THE LAST GOODBYE 10 4 A string which length is lt length gt extracted from the source string GOOD NOTES None BUGS None function PEEK function PEEK NAME PEEK Gives contents of memory location ABBREVIATION p lt shift gt E SYNOPSIS PEEK lt address gt FUNCTION
60. e are also operators for equalities and inequalities called relational operators Arithmetic operators always take priority over relational operators equal to lt less than gt greater than lt less than or equal to lt less than or equal to gt greater than or equal to gt greater than or equal to lt gt not equal to gt lt not equal to Finally there are thee logical operators with lower priority than both arithmetic and relational operators AND OR NOT These are used most often to join multiple formulas in IF THEN statements When they are used with arithmetic operators they are evaluated last i e after and Examples IF A B AND C D THEN 100 Requires both A B amp C D to be tru 32 IF A B OR C D THEN 100 Allows either A B or C D to be tru A 5 B 4 PRINT A B Displays a value of 0 A 5 B 4 PRINT A gt B Displays a value of l PRINT 123 AND 15 PRINT 5 OR 7 Displays 11 and 7 STATEMENTS BOX CHAR CIRCLE s q Cit KEY OSUB GOTO GRAPHIC GSHAPE IF INPUT INPUT ET OCATI MONITOR NEXT ON OPEN PAINT POKE PRINT PRINT USING PRINT PUDEF READ REM RESTORE RESUME RETURN SCALE SCNCLR SOUND SSHAPE STOP SYS TRAP TROFF TRON VOL WAIT j Hoz fx QQOQ 7 33 statement BOX F E NAM statement BOX BOX Draws a rectangle A
61. e in that location so be careful with your tapes If you type SAVE command followed by a name in quotes or a string variable name the computer gives the program that name so it may be more easily located and retrieved in the future If you want to specify a device number for the SAVE follow the name by a comma after the quotes and a number or numeric variabl After the number on a tape command there can be a comma and a second number 0 or 1 If the second number is 1 the computer puts an END OF TAPE marker lt eot_flag gt after your program If you are trying to LOAD a program and the computer finds one of these markers rather than the program you are trying to LOAD you get a FILE NOT FOUND ERROR INPUTS lt file gt file name lt device gt storage device number 13 lt eot_flag gt end of tape flag 0 or 1 RESULT The program currently in memory is stored in a storage device EXAMPLES SAVE Stores program to tape without a name SAVE MONEY Stores on tape with name MONEY SAVE AS Stores on tape with name in variable AS SAVE YOURSELF 8 Stores on disk with name YOURSELF SAVE GAME 1 1 Stores on tape with name GAM the program EA and places an END OF TAPE marker after NOTES Device 1 tape drive Device 8 disk drive BUGS None command SCRATCH command SCRATCH NAME SCRATCH Deletes a file from disk ABBREVIATIO
62. ent PC location ABBREVIATION r lt shift gt D SYNOPSIS RDOT lt info_flag gt FUNCTION This function returns information about the current position of the pixel cursor PC at XPOS YPOS INPUTS lt info _flag gt required information 0 current pixel cursor x position 1 current pixel cursor y position 2 color source used at current PC position RESULT 25 Returns PC s current x position y position or color source used at current PC position numeric EXAMPLES None NOTES None BUGS None None function RGR function RGR NAME RGR Returns current graphic mode ABBREVIATION r lt shift gt G SYNOPSIS RGR lt dummy gt FUNCTION EXA a This function returns current graphic mode 0 normal text 1 high resolution graphics 2 high resolution graphics split screen 3 multicolor graphics 4 multicolor graphics split screen UTS lt dummy gt dummy argument and can be any value ULT Current graphic mode numeric NOT PLES None ction RIGHT function RIGHTS RIGHTS Strips string from the left ABBREVIATION SYNOPSIS r lt shift gt I RIGHTS lt string gt lt length gt FUNCTION a This function returns a string containing the right most lt length gt characters of string lt string gt INPUTS EXA lt string gt source string lt length gt number of characters to be included in res
63. er 01 lt deleted gt gives information about the number of files deleted with the SCRATCH command disk _error 20 READ ERROR disk _error 20 READ ERROR NUMBER 20 MESSAGE READ ERROR DESCRIPTION Block header not found The disk controller is unable to locate the header of the requested data block Caused by an illegal sector number or the header has been 72 destroyed ERROR disk error 21 READ ERROR disk error 21 READ NUMBER 21 MESSAGE READ ERROR DESCRIPTION No sync character The disk controller is unable to detect a sync mark on the desired track Caused by misalignment of the read write head no disk is hardware failure disk error 22 READ ERROR disk _error 22 READ present or unformatted or improperly seated disk Can also indicate a ERROR NUMBER 22 MESSAGE READ ERROR DESCRIPTION Data block not present The disk controller has been requested to read or verify a data block with the BLOCK commands and indicates an illegal track and or sector that was not properly written This error message occurs in conjunction request disk error 23 READ ERROR disk error 23 READ ERROR NUMBER 23 MESSAGE READ ERROR DESCRIPTION Checksum error in
64. eter ABBREVIATION lt shift gt S SYNOPSIS USR lt parameter gt FUNCTION When this function is used the program jumps to a machine language program whose starting point is contained in memory locations 1281 lower byte of the 16 bit memory address and 1282 higher byte of th 16 bit memory address The parameter lt parameter gt is passed to the machine language program in the floating point accumulator Another number is passed back to the BASIC program by the machine language program through the calling variable In other words this allows you to exchange a variable between machine code and BASIC INPUTS lt parameter gt numeric value to be passed to the machine language program RESULT USR calls a machine language program with a given numeric parameter While exiting machine language program passes a another number back to the BASIC EXAMPLES None NOTES I don t exactly know how the machine language program passes the value back to the BASIC Maybe there is a special variable for this I don t know BUGS None function VAL function VAL NAME VAL Converts string into a number ABBREVIATION None SYNOPSIS VAL lt string gt FUNCTION This function converts the string lt string gt into a number and is essentially the inverse operation from STR The string is examined from the left most character to the right for as many characters as are in recognizable
65. ext line unless an ELSE clause is present Th expression being evaluated may be a variable or formula in which case it is considered true if nonzero and false if zero In most cases there is an expression involving relational operators lt gt lt gt lt gt AND OR NOT The ELSE clause if present must be in the same line as the IF THEN part When an ELSE clause is present it is executed when the THEN clause isn t executed In other words the ELSE claus xecutes when th IF expression is FALSE INPUTS lt expression gt condition BASIC expression resulting true or false value lt clause gt statements to be executed RESULT If expression lt expression gt is true statements following the word THEN will be executed and if expression is false statements following the word ELSE will be executed If ELSE is not present program goes directly to the next line EXAMPLES THEN Print OK 4 eerie a eee L Yes IF he a a poor H Check 1 X gt 0 Tana eet an i ELSE No 4 Ns End 50 IF X gt 0 THEN PRINT OK ELSE END Checks the value of X If X is greater than 0 the THEN clause is executed and the ELSE clause isn t If X is not greater than 0 the ELSE clause is executed and the THEN clause isn t
66. he cursor is positioned under the name VS ES E None BUGS sta NAM None tement STOP statement STOP m E STOP Halts the program execution ABBREVIATION s lt shift gt T SYNOPSIS STOP FUNCTION EXA This statement halts the program A message BREAK IN LINE lt line gt where the lt line gt is the line number containing the STOP The program can be re started at the statement following STOP if you use the CONT command The STOP statement is usually used while debugging a program UTS None ULT Halts the program execution PLES NOT 100 STOP ES E None BUGS sta NAM ABBREVIATION None tement SYS statement SYS m E SYS Executes a machine language program s lt shift gt Y SYNOPSIS SYS lt address gt 61 FUN EXA CTION The word SYS is followed by a decimal number or numeric variable in the range 0 to 65535 The program begins executing the machine language program starting at that memory location This is similar to the USR function but does not pass a parameter However parameters can be passed anyway using the following memory locations 2034 Accumulator 2035 X register 2036 Y register These can be used both before SYS to set the processor registers for example POKE 2034 255 and after the return from the machine language routine to check the results for example
67. ight decimal places followed by the letter E and the power of ten by which the number is multiplied For xample the number 12345678901 is displayed as 1 23456789E 10 INTEGER VARIABLES 64 Integer variables can be used when the number is from 32767 to 32768 and with no fractional portion An integer variable is a number like 5 10 or 100 Integers take up less space than floating point variables when used in an array STRING VARIABLES VAR String variables are those used for character data which may contain numbers letters and any other character that your computer can make An example of a string variable is COMMODORE 16 IABLE NAMES Variable names may consist of a single letter a letter followed by a number or two letters Variable names may be longer than 2 characters but only the first two are significant An integer variable is specified by using the percent sign after the variable name String variables have the dollar sign after their names Examples Numeric Variable Names A A5 BZ Integer Variable Names A A5 BZ String Variable Names AS A5 BZ ARRAYS Arrays are lists of variables with the same name using an extra number or numbers to specify an element of the array Arrays are defined using the DIM statement and may be floating point integer or string variables arrays The array variable name is followed by a set of parentheses
68. in lt seed gt should be a 1 or any positive is zero RND is re seeded from the hardware clock ever time RND is used A negative valu generator using lt seed gt and gives a random number sequence The use of number for lt seed gt as a seed results in the same sequence of random numbers A positive value gives random numbers based on the previous seed for lt s numeric 27 d gt seeds the random number or what the random number is based on 100 X INT RND 1 150 100 Number from 100 to 249 NOTES To simulate the rolling of a die use the formula INT RND 1 6 1 First the random number from 0 1 is multiplied by 6 which expands the range to 0 6 actually greater than zero and less than six Then 1 is added making the range 1 to under 7 The INT function chops off all the decimal places leaving the result as a digit from 1 to 6 To simulate 2 dice add two of the numbers obtained by the above formula together BUGS None None function SGN function SGN NAME SGN Returns number s sign ABBREVIATION s lt shift gt G SYNOPSIS SGN lt number gt FUNCTION a This function returns the sign as in positive negative or zero of lt number gt The result is 1 if lt number gt is positive 0 if lt number gt is zero 1 if lt number gt is negative INPUTS lt number gt number to b valuated RESULT Number s sign 1 is returned if number was negat
69. ion of the where the comma appears in a printed Only commas within a number are printed Unused commas to the the filler character At least one field number is negative then a character even if the character t a dollar sign will be printed in the always be placed befor before the dollar sign the dollar sign is ast on If printed in the position shown in the format field If you specify commas and or a plus or minus sign in a format field with a dollar sign sign The four up arrows or care number is to be printed in your program prints CS format field You must specify four carets E format scientific notation If than four carets you get a syntax carets only the first four carets are interpreted lit An equal sign is used to cen the field width by the number of field If the string is centered in the field and the string fills the entire A greater than sign gt is used to You specify the field width by the format field width the string is right justi e INPUTS lt file gt lt printlist gt items to be printed ESULT a file or device EXAMPLES 5 X 32 Y 100 23 A CAT 10 PRINT USING S 13 25 X Y 20 PRINT USING gt CBM AS When you RUN this 13 25832 005 A8S2 E format to specify the field width The must appear after the in the AERA are used rally as n
70. ive 0 if number was zero or 1 if number was positive numeric EXAMPLES None NOTES None BUGS None function SIN function SIN NAM SIN Returns sine value ABBREVIATION s lt shift gt I SYNOPSIS SIN lt angle gt FUNCTION a This is the trigonometric sine function The result is the sine of lt angle gt where lt angle gt is an angle in radians INPUTS RESULT lt angle gt angle in radians Sine value of an angle numeric EXAMPLES lt example function _call gt 28 NOTES None BUGS None function SPC function SPC NAME SPC Skips over spaces ABBREVIATION s lt shift gt P SYNOPSIS SPC lt skip gt FUNCTION This function is used in the PRINT statement to skip over lt skip gt spaces INPUTS lt skip gt number of spaces to be skipped 0 255 RESULT Skips over lt skip gt spaces in the PRINT statement EXAMPLES None NOTES function SQR function SOQR NAME SQR Returns the square root ABBREVIATION s lt shift gt Q SYNOPSIS SQR lt number gt FUNCTION This function returns the square root of lt number gt where lt number gt is a positive number or 0 If lt number gt is negative an ILLEGAL QUANTITY ERROR results INPUTS lt number gt number to b valuated RESULT Square root of the given number numeric EXAMPLES None NOTES
71. ize the command The command must start in the first position disk _error 32_SYNTAX_ERROR NUMBI MESSAGE ER 32 SYNTAX DESCRIPTION Invalid command ERROR disk _error 32_SYNTAX_ERROR The command sent is longer than 58 characters disk _error 33 SYNTAX ERROR NUMBI MESSAGE ER 39 J SYNTAX ESCRIPTION ERROR Invalid file name Pattern matching is invalidly used in the OPEN or SAVE disk _error 34 SYNTAX ERROR was left out of a command or the DOS does not recognize NUMBER 34 MESSAGE SYNTAX ERROR DESCRIPTION No file given The file nam as such Typically a colon disk _error 39 SYNTAX ERROR N UMB ESS ER 39 AGE disk _error 50_R N ESC ESS UMB SYNTAX RIPTION Invalid command This error may result if is unrecognized by the DOS address 15 ER 50 AGE disk_error 51_0V ESC RECORD NOT RIPTION commands T detected wi ERROR the ECORD NOT PRESENT Result of dis PR k reading past his message will beyond end of file in a relative file file by adding the new record may be ignored hout first repositioning ENT INPUT or GET ERFLOW IN RECORD disk _error 33_SYNTAX_ERROR command disk _error 34_SYNTAX_ERROR has been left out of the command
72. l get an error if AS is empty NOTES The DLOAD command can be used within a BASIC program to find and RUN another program on disk This is called chaining BUGS None command DSAV Ca command DSAV Ca NAME DSAVE Stores a program on disk E ABBREVIATION d lt shift gt S SYNOPSIS DSAVE lt file gt D lt drive gt U lt unit gt FUNCTION This command stores a program on disk Use SAVE to store programs on tape You must supply a file name INPUTS lt file gt file name and or pattern lt drive gt drive number lt unit gt drive unit number RESULT EXAMPLES DSAVE DSAVE AS DSAVE DDAY SAVES the program DDAY to disk PROG 3 D0 U9 A program is stored on a disk SAVEs to disk program whose name is in the variable AS SAVEs the program PROG 3 to the disk drive with a unit number of 9 NOTES None BUGS None command HEADER NAME ABBREVIATION he lt shift gt SYNOPSIS FUNCTION can use the HEAD called blocks on the disk catalogue A HEADER Formats a disk ER command T and it creates The disk If you want his a HEADER lt diskname gt D lt drive gt I lt id gt ON U lt unit gt CO ras table of long The id number is any 2 characters number B erases all stored data quick header careful when y
73. lements lt subscripts gt in each dimension An array with more than one dimension is called a matrix You may use any number of dimensions but keep in mind that the whole list of variables you are creating takes up space in memory and it is easy to run out of memory if you get carried away To figure the number of variables created with each DIM multiply the total number of elements in each dimension of the array You can dimension more than one array in a DIM statement by separating the arrays by commas If the program executes a DIM statement for any array more than once you ll get re DIMed array error message It is good programming practice to place DIM statements near the beginning of the program INPUTS lt variable gt array name legal variable name lt subscripts gt number of elements in an array RESULT Presents and reserves memory for an array or arrays EXAMPLES DIM A 40 B7 15 CC 4 4 4 l 125 Elements 16 Elements Fedenn ee 41 Elements NOTES Each array starts with element 0 Integer single digit arrays take up 2 5ths of the space of floating point arrays BUGS None None statement DO statement DO NAME DO Defines a program loop ABBREVIATION DO None EXIT None LOOP lo lt shift gt O UNTIL u lt shift gt N WHILE w lt shift gt H SYNOPSIS DO UNTIL lt bool_arg gt WHILE lt bool_arg gt lt statements gt
74. lowing the second number may be a third number called the secondary address lt address gt In the case of the tape this can be 0 for read 1 for write and 2 for write with end of tape marker at the end In the case of the disk the number refers to the channel number In the printer the secondary addresses are used to set the mode of th Hh ct J 50 printer There may also be a string following the third number which could be a command to the disk drive or name of the file on tape or disk lt command gt The type lt type gt and mode lt mode gt refer to disk files only File types are prg seq rel and usr modes are read and write INPUTS lt file gt logical file number for the file to be opened 1 255 lt device gt input output device number lt address gt secondary address for device lt command gt command for device lt type gt file type prg seq rel usr lt mode gt I O mode read write RESULT Opens a logical file for I O operations EXAMPLES 10 OPEN 3 3 OPENs the screen as a device 10 OPEN 1 0 OPENs the keyboard as a device 10 OPEN 1 1 0 UP OPENs the tape for reading file to be searched for is named UP OPEN 4 4 OPENs a channel to use the printer OPEN 15 8 15 OPENs the command channel on the disk 5 OPEN 8 8 12 TESTFILE SEQ WRITE Creates a sequential disk file for writi
75. lt ctrl valuel gt lt ctrl_value2 gt FUNCTION The WAIT statement is used to halt the program until the contents of a location in memory changes in a specific way The address lt address gt must be in the range from 0 to 65535 Value 1 lt ctrl_valuel gt and value 2 lt ctrl_value2 gt must be in the range from 0 to 255 The content of the memory location is first exclusive ORed XOR with value 2 if present and then logically ANDed AND with value 1 If the result is zero the program checks the memory location again When the result is not zero the program continues with the next statement INPUTS lt address gt memory location to be monitored 0 65535 lt ctrl_valuel gt first control value 0 255 lt ctrl_value2 gt second control value 0 255 RESULT Halts program execution until the contents of a given memory address changes EXAMPLES None NOTES None BUGS None A A I n ne a VARIABLES Your computer uses thr types of variables in BASIC These are normal numeric integer numeric and string alphanumeric variables NUM Fl RIC VARIABLES Normal numeric variables also called floating point variables can have any value from 38 to 38 with up to nine digits of accuracy When a number becomes larger than nine digits can show as in 10 10 or 10 10 your computer displays it in scientific notation form with the number normalized to 1 digit and e
76. n OR is executed with the shape data and the bit map to be replaced the graphic area Result is a transparent shape on top of the bit map In mode 3 logical operation AND is executed with the shape data and the bit map to be replaced Result is a shape filtered bit map In mode 4 logical operation XOR is executed with the shape data and the bit map to be replaced Result is a shape filtered bit map INPUTS lt shape gt string variable containing a shape to be drawn lt x gt scaled x coordinate The default display position is the PC pixel cursor lt y gt scaled y coordinate The default display position is the PC pixel cursor lt mode gt replacement mode 0 4 RESULT Displays a shape on a graphic screen 45 EXAMPLES GSHAPE VS 1 Displays V shape with background and foreground colors reversed with the top left of the shape positioned at the pixel cursor PC NOTES None BUGS None statement IF statement IF NAME IF Conditional execution ABBREVIATION None SYNOPSIS IF lt expression gt THEN lt clause gt ELSE lt clause gt FUNCTION IF THEN lets the computer analyze a BASIC expression preceded by IF and take one of two possible courses of action If the expression is true the statement following THEN is executed This expression may be any BASIC statement If the expression is false the program goes directly to the n
77. ng NOTES None BUGS None statement PAINT statement PAINT NAME PAINT Fills an area with color ABBREVIATION p lt shift gt A SYNOPSIS PAINT lt color_ src gt lt x gt lt y gt lt mode gt FUNCTION The PAINT command lets you fill an area with color It fills in the area around the specified point until a boundary of the same color or any non background color depending on which mode you have chosen is ncountered The final position of the Pixel Cursor PC will be at the starting point lt x gt lt y gt INPUTS lt color src gt fill color source 0 3 default is 1 foreground color lt x gt scaled x coordinate starting point lt y gt scaled y coordinate starting point lt mode gt fill mode 0 paint an area defined by the color source selected 1 paint an area defined by any non background color source RESULT Fills in the area around the specified point until a boundary of the same color or any non background color depending on which mode you have chosen is encountered EXAMPLES 10 CIRCLE 160 100 65 50 20 PAINT 160 100 Draws outline of circle and fills in the circle with color NOTES 51 If the starting point is already the color of color source you name or any non background when mode 1 is used there is no change BUGS statement POK NAME None Fl statement POK Ca E POKE Write
78. number ncountered since th R The variable EL is used typically in error trapping routines The variable ER is used typically in error trapping routines was run PLES None NOTES None variable ST NAME ST Input output status DESCRIPTION EXA ST is a status variable for input and output except normal the last input output operation PLES vari NAME DESC NOTES None None able TI TI Clock value RIPTION a second 66 The variable DS reads the disk drive command channel and returns the DS is used after a disk operation like DLOAD or DSAVE to find out why variable EL EL stores Gl a variable ER stores program variable ST screen keyboard operations The value of ST depends on the results of variable TI I variable contains the current value of the clock in 1 60ths of a EXAMPLES None NOTES None variable TIS variable TIS NAME TIS Current time DESCRIPTION TIS is a string that reads the value of the real time clock as a 24 hour clock The first two characters of TIS contain the hour the 3rd and 4th characters are the minutes and the 5th and 6th characters are the seconds This variable can be set to any value so long as all characters are numbers and will be automatically updated as a 24 hour clock The value of the clock is lost when computer is
79. number format If the computer finds illegal characters only the portion of the string up to that point is converted INPUTS lt string gt string containing a number RESULT Number corresponding the number given in string numeric EXAMPLES 31 10 X VAL 123 456 X 123 456 10 X VAL 3E03 X 3000 10 X VAL 12A13B X 12 10 X VAL RIUO17 X 0 10 X VAL 1 23 23 23 1 23 NOTES None BUGS None A A ORI _ aca OPERATORS The arithmetic operators include the following signs addition subtraction multiplication division raising to a power exponentiation up arrow gt 1 On a line containing more than one operator there is a set order in which operations always occur If several operators are used together the computer assigns priorities as follows First exponentiation then multiplication and division and last addition and subtraction If two operations have the same priority then calculations are performed in order from left to right If you want these operations to occur in a different order BASIC allows you to give a calculation a higher priority by placing parentheses around it Operations enclosed in parentheses will be calculated before any other operation You have to make sure that your equations have the same number of left parentheses as right parentheses or you will get a SYNTAX ERROR message when your program is run Ther
80. o text symbols ter as charac string contains fewer characters than The right most field If the string contains fewer charac fied in contains more characters than can be fit characters are truncated and the string fills Given printlist is formatted and displayed on t a comma or sign before the dollar symbol is used to specify that the You must use in addition to the when you want to print a number in you specify more than one but fewer error If you specify more than four The fifth caret and subsequent tring in the ters and field You specify in the format the field width the characters are truncated right justify a string in a field number of characters and in t ters than the field eld If the string the field the right mos he entire field ne the fi into logical number of target file devic lt formatlist gt printlist is formatted by using these format instructions he screen or written into line 10 prints out PRINT USING prints instead of Y value because Y has 5 digits which does not conform to format list Line 20 prints this CBM CAT PRINT USING leaves thr format list 10 PRINT USING X For these values for X spaces befor printing CBM as defined in this format displays 54 12 34 12 567 89 568 123456 TERR A A A 10 PRINT USING 01 Result 0 01 Leading zero added 10 PR
81. of the quotes and a number or numeric variable 10 which acts as a device number to determine where the program is stored disk or tape If there is no number given your computer assumes device number 1 The LOAD command can be used within a BASIC program to find and RUN the ext program on tape This is called chaining he relocate flag lt rel_flag gt determines where in memory a program is oaded A relocate flag of 0 tells the computer to load the program at he start of the BASIC program area and a flag of 1 tells it to LOAD from the point where it was SAVEd The default value of the relocat 3 m ct flag is 0 INPUTS lt file gt file name and or pattern to be loaded lt device gt storage device number lt rel flag gt relocate flag 0 or 1 RESULT A program is loaded from storage device into a memory EXAMPLES LOAD Reads in the next program on tape LOAD BASES Searches tape for a program called BASES and LOADS it if it is found LOAD AS Looks for a program whose name is in the variable called A LOAD BRIDGES 8 Looks for the program called BRIDGES on the disk drive and LOADs it if found NOTES Device 1 Tape Device 8 Disk i Relocate flag of 1 is generally used only when loading machine language programs BUGS None td ti command NI command N NAME
82. on lt err condition gt INPUTS lt err_ condition gt error condition number RESULT rror message string ts EXAMPLES None NOTES function EXP function EXP NAME EXP Raises constant to the given power ABBREVIATION e lt shift gt X SYNOPSIS EXP lt power gt FUNCTION Returns the value of the mathematical constant e 2 71828183 raised to the power of lt power gt INPUTS lt power gt power number RESULT Raises constant to the given power EXAMPLES NOTES function FN function FN NAME FN Calls user defined function ABBREVIATION None SYNOPSIS FN lt fnc_name gt lt number gt FUNCTION Returns the value of the user defined function lt fnc_name gt created in a DEF FN statement INPUTS lt fnc_name gt name of the user defined function lt number gt value to be passed to the function 19 EXA Returns the result of the called function numeric PLES NOT func NAM F E None tion FRE function FRE FRI GI Returns the amount of available memory ABBREVIATION f lt shift gt R SYNOPSIS FRE lt dummy gt FUNCTION EXA U U a This function returns the number of unused bytes available in memory TS lt dummy gt dummy argument and can be any value LT Amount of free memo
83. open logical file ABBREVIATION 35 cl lt shift gt O SYNOPSIS CLOSE lt file gt FUNCTION This command completes and closes any files used by OPEN statements INPUTS lt file gt file number to be closed RESULT Closes an open logical file EXAMPLES CLOSE 2 Logical file 2 is closed NOTES None BUGS None statement CLR statement CLR NAME CLR Erases any variables in memory ABBREVIATION c lt shift gt L SYNOPSIS CLR FUNCTION This command erases any variables in memory but leaves the program itself intact This command is automatically executed when a RUN or NEW command is given or when any editing is performed INPUTS None RESULT rases any variables in memory zal EXAMPLES NOTES statement CMD statement CMD NAME CMD Redirects output ABBREVIATION c lt shift gt M SYNOPSIS CMD lt l _file gt lt w_list gt FUNCTION CMD sends the output which normally would go to the screen i e PRINT statement LISTs but not POKEs into the screen to another device instead This could be a printer or a data file on tape or disk This device or file must be OPENed first The CMD command must be followed by a number or numeric variable referring to the file lt l _ file gt INPUTS lt l _ file gt logical file number lt w_list gt UNKNOWN ARGUMENT 36 RESULT Redirects o
84. ore the first digit or 53 dollar symbol if th number is positive This means tha the number is positive the field is filled with asterisks A decimal point symbol designa in the number If you don t specify a decimal point in your format field rounded to th When you speci nearest integer and fy a decimal point decimal point including the minus not exceed the number of before many digits an overflow occurs and A comma comma in the format list indicates number left of the first digit appear as must precede the first comma in a If you specify commas in a field and th minus sign is printed as the first position is specified as a comma A dollar sign symbol shows tha number the number you must specify at 1 you specify a dollar sign without a leading number is negativ and no sign is printed if the t you can print one character more if If there are too many digits to fit into the field specified by the and or signs then an overflow occurs and tes the position of the decimal point You can only have one decimal point in any format field the value is printed without any decimal places the number of digits preceding the sign if the value is negative must lets you place commas in numeric fields If you want the dollar sign to float the decimal point If there are too the field is filled with asterisks The posit
85. ou HI EAD ER a dis Giving no id number allows you The old id number is used header method if the disk was previously header only cleans out the direc INPUTS lt diskname gt lt drive gt lt id gt lt unit gt A ready to HEADER TH name for the disk drive number disk identification number max length 2 characters drive unit number use empty disk EBALL NOTES command HELP NAME ABBREVIATION None SYNOPSIS HELP S HEADER MYDISK 123 D0 145 D1 U8 tory rat max leng name can be any name u command HEADER Before you can use a new disk for the first time you must format it with the HEADER command an entire disk for re use you command divides the disk into sections contents called a directory or p to 16 characters Give each disk a unique id k because the HEAD ER command You can only use to perform a the quick formatted since th 16 characters HELP Displays the erroneous program line the quick her than formatting the disk command HELP FUNCTION EXA ULT The HELP command is used after you get an error in your program When you type HELP the line where th rror occurred is listed with the portion containing the error displayed in flashing characters UTS None Displays the line which has caused the last error The portion
86. ram lines ABBREVIATION SYNO FUNC ren lt shift gt U PSIS RENUMBER lt new_line gt lt increment gt lt start_line gt TION This command renumbers BASIC program lines beginning from the first line set as 10 renumbering in increments of 10 at the end of the program You can supply starting line lt start_line gt spacing between line umbers lt increment gt and or first line number lt new_line gt he first line number is the number of the first line in the program after renumbering default is 10 The increment is the spacing between line numbers i e 10 20 30 etc It also defaults to 10 The first line number is the line number in the program where renumbering is to begin This allows you to renumber a portion of your program It defaults to the first line of your program 3 415 INPUTS lt new_line gt line number which replaces the start line number lt start_line gt Default line number is 10 lt increment gt spacing between line numbers default is 10 lt start_line gt line number where renumbering starts default is the first line RESULT Renumbered program line s EXAMPLES RENUMBER 20 20 1 Starting at line 1 renumbers the program Line 1 becomes line 20 and other lines are numbered in increments of 20 RENUMBER 65 Starting at line 65 renumbers in increments of 10 Line 65 becomes line 10 unless the
87. rams by typing the line numbers for you As you enter each program line and press lt return gt the next line number is printed on the screen with the cursor in position to begin typing that line AUTO with no argument turns off auto line numbering as does RUN INPUTS lt line gt increment between line numbers With argument turns on automatic line numbering With no argument turns off auto line numbering EXAMPLES AUTO 10 Automatically numbers line in increments of ten AUTO 50 Automatically numbers line in increments of fifty AUTO Turns off automatic line numbering NOTES This statement is executable only in direct mode BUGS None command BACKUP command BACKUP NAME BACKUP Copies all the files on a disk to another disk ABBREVIATION b lt shift gt A SYNOPSIS BACKUP D lt src_drive gt TO D lt trg drive gt ON U lt unit gt FUNCTION m his command copies all the files on a disk to another disk on a dual drive system You can copy onto a new disk without first using the HEADER command to format the new disk because the BACKUP command copies all the information on the disk including the format You should always BACKUP important disks in case the original is lost or damaged Because the BACKUP command also HEADERS disks it destroys any information on the disk onto which you re copying information So if you re backing up onto a previously used disk make
88. raw color source 0 3 lt x gt scaled x coordinate lt y gt scaled y coordinate RESULT Draws dots lines or shapes EXAMPLES DRAW 1 100 50 Draws a dot DRAW 10 10 TO 100 60 Draws a line DRAW TO 25 30 Draws a line DRAW 10 10 TO 100 60 TO 10 10 Draws a shape NOTES None BUGS None statement END NAME END Stops program execution ABBREVIATION e lt shift gt N SYNOPSIS END FUNCTION With this command you can draw individual dots lines and shapes You supply color source lt color_src gt starting and ending points lt x gt lt y gt default is 1 foreground color statement END When the program executes an END statement the program stops RUNning 40 immediately You may use the CONT command to restart the program at the statement following the UTS None ULT EXA Program stops running ES sta NAM NOT tement FOR F E FOR Defines a program loop ABBREVIATION f lt shift gt O SYNOPSIS FOR lt loop_var gt lt start_val gt TO lt end_val gt FUNCTION This statement works program that repeats computer to count up to a large seconds in case you need somet certain number of times The loop variable lt loop_var gt subtracted from during the FOR N and the end value lt end_val gt the loop variable The logic of the FOR statement lt loop_var gt is set
89. re are already lines numbered 10 64 in which 12 NOTES case the command is not carried out This command can only be executed from direct mode BUGS None None command RUN command RUN NAME RUN Executes a program ABBREVIATION r lt shift gt U SYNOPSIS RUN lt line gt FUNCTION Once program has been typed into memory or LOADed the RUN command makes it start working RUN clears all variables in the program before starting program execution If there is no number following the command RUN the computer starts with the lowest numbered program line If there is a number following the RUN command execution starts at that line INPUTS lt line gt line number where program execution should start RESULT BASIC program is executed EXAMPLES RUN Starts program working from lowest line number RUN 100 Starts program at line 100 NOTES RUN may be used within a program BUGS None command SAVE command SAVE NAME SAVE Stores program in a storage device ABBREVIATION s lt shift gt A SYNOPSIS SAVE lt file gt lt device gt lt eot_flag gt FUNCTION This command stores a program currently in memory onto a tape or disk If you just type the word SAVE and press lt return gt your computer attempts to store the program on the tape It has no way of checking if there is already a program on the tap
90. rive NOTES None BUGS None command DELETE command DELETE NAME DELETE Deletes lines of BASIC text ABBREVIATION de lt shift gt L SYNOPSIS DELETE lt first_line gt lt last_line gt FUNCTION Deletes lines of BASIC text INPUTS lt first_line gt first line to be deleted lt last_line gt last line to be deleted RESULT Deletes lines of BASIC text EXAMPLI DELETE 75 Deletes line 75 Tj n DELETE 10 50 Deletes lines 10 through 50 inclusive DELETE 50 Deletes all lines from the beginning of the program up to and including line 50 DELETE 75 Deletes all lines from 75 on to the end of the program NOTES This command can be executed only in direct mode BUGS None command DIRECTORY command DIRECTORY NAME DIRECTORY Displays a disk directory ABBREVIATION di lt shift gt R SYNOPSIS DIRECTORY D lt drive gt U lt unit gt lt file gt FUNCTION Displays a disk directory on the screen Use lt ctrl gt S to pause the display any other key restarts the display after a pause Use the C key the Commodore key to slow it down INPUTS lt drive gt drive number lt unit gt drive unit number lt file gt file name and or pattern RESULT Lists all files or files matching the given pat
91. ry in bytes PLES NOT fun NAM Cc None None tion HEXS function HEXS HEXS Converts a decimal number into a hexadecimal one ABBREVIATION h lt shift gt E SYNOPSIS HEXS lt number gt FUNCTION U U m his function returns a 4 character string containing the hexadecimal representation of value lt number gt TS lt number gt value to b valuated 0 65535 Ga 1 EXA Hexadecimal representation of the given decimal value string PLES NOT fun None tion INSTR function INSTR 20 NAME INSTR Searches for a sub string ABBREVIATION in lt shift gt S SYNOPSIS INSTR lt string 1 gt lt string_ 2 gt lt start_pos gt FUNCTION Returns position of string lt string 2 gt in string lt string_1 gt at or after the starting position lt start_pos gt The starting position defaults to the beginning of string lt string 2 gt If no match is found a value of 0 is returned INPUTS lt string 1 gt string to be searched lt string 2 gt string to search lt start_pos gt position where searching should start RESULT Returns position of the second string in the first string numeric If the string was not found returns 0 EXAMPLES PRINT INSTR THE CAT IN THE HAT CAT The result is 5 because CAT starts at the fifth character in the first string
92. s a value into a RAM memory ABBREVIATION p lt shift gt SYNOPSIS FUNCTION POKE lt address gt lt value gt The POKE command allows you to change any value in the computer RAM memory and lets you modify many of the computer input output registers POKE is always followed by two numbers or equations The first number lt address gt is a location inside your computer s memory This could have any value from 0 to 65535 The second number lt value gt is a value from 0 to 255 which is placed in the location replacing any value that was there previously This command can be used to control anything on the screen from placing a character at that location to changing the color there INPUTS lt address gt memory address location 0 65535 lt value gt value to be stored in a given address 0 255 RESULT Given value is stored in a given memory location EXAMPLES NOT 10 POKE 16000 8 Sets location 16000 to 8 T 20 POKE 16 1000 27 Sets location 16000 to 27 ES None BUGS sta NAME ABB SYN FUN None tement PRINT statement PRINT PRINT Writes data to the screen REVIATION OPSIS PRINT lt printlist gt CTION The PRINT statement is the major output statement in BASIC While the PRINT statement is the first BASIC statement most people learn to use there are many subtleties to be mastered here as well The word PRINT can
93. s are given they are completed in order from left to right lt variable gt name of the FOR loop variable RESULT Causes computer to go back to the corresponding FOR statement and check the FOR loop variable Depending on loop variable value NEXT either exits the loop or repeats it once more NOT EXAMPLES 10 FOR L 1 TO 10 NEXT 20 FOR L 1 TO 10 NEXT L 30 FOR L 1 TO 10 FOR M 1 TO 10 NEXT M L ES E None 49 BUGS None statement ON statement ON NAME ON Redirects program execution conditionally ABBREVIATION None SYNOPSIS FUNC INPU RESU ON lt expression gt GOSUB lt line gt lt gt lt line gt ON lt expression gt GOTO lt line gt lt gt lt line gt TION This command can make the GOTO and GOSUB statements into special versions of the IF statement The word ON is followed by a formula then either GOTO or GOSUB and a list of line numbers separated by commas If the result of the calculation of the formula lt expression gt is 1 the first line lt line gt in the list is executed If the result is 2 the second line number is executed and so on If the result is 0 or larger than the number of line numbers in the list the next lin xecuted is the statement following the ON statements If the number is negative an ILLEGAL QUANTITY ERROR results TS lt expression gt BASIC expression resulting
94. statements let you define the format of string and numeric items you want to print to the screen printer or another device Put the format you want in quotes This is the format list lt formatlist gt Then add a semicolon and a list of what you want printed in the format for the print list lt printlist gt The list can be variables or the actual values you want printed Hash Sign Plus Minus Decimal Point Comma Dollar Sign Four Carets Equal Sign Greater Than Sign The hash sign reserves room for a single character in the output field If the data item contains more characters than you have in your format field PRINT USING prints nothing For a numeric item th ntir field is filled with asterisks No numbers are printed For a STRING item the string data is truncated at the bounds of the field Only as many characters are printed as there are hash signs in the format item Truncation occurs on the right The plus and minus signs can be used in either the first or last position of a format field but not both The plus sign is printed if the number is positive The minus sign is printed if the number is negative If you use minus sign and the number is positive a blank is printed in the character position indicated by the minus sign If you don t use either a plus or minus sign in your format field for a numeric data item a minus sign is printed bef
95. tem gt lt gt lt item gt FUNCTION This statement is followed by a list of items to be used by READ statements The items may be numbers or words and are separated by commas Words need not be inside of quote marks unless they contain any of the following characters space colon or comma If two commas have nothing between them the value will be READ as a zero fora number or an empty string The DATA statement must be part of a program otherwise it will not be recognized Also see the RESTORE statement which allows your computer to reread data INPUTS lt item gt constant which will be declared as a data item RESULT Declares data items to be read by READ command EXAMPLES DATA 100 200 FRED WILMA 3 14 ABC123 NOTES None BUGS None EF statement DEF statement D NAME DEF FN Defines a function ABBREVIATION d lt shift gt zal SYNOPSIS DEF FN lt fnc_name gt lt variable gt lt expression gt FUNCTION This command allows you to define a complex calculation as a function In the case of a long formula that is used several times within a program this can save a lot of space The name you give the numeric function begins with the letters FN followed by any legal numeric variable name lt fnc_name gt First you must define the function by using the statement DEF followed by the name lt fnc_name gt you ve given
96. tern EXAMPLES DIRECTORY List all files on the disk DIRECTORY D1 U9 WORK Lists the file on disk drive unit 9 8 is default drive 1 named WORK DIRECTORY AB Lists all files starting with the letters AB like ABOV etc Fl ABOARD DIRECTORY DO FILE BAK The is a wild card that matches any single character in that position FILE 1 BAK FILE 2 BAK FILE 3 BAK all match the string NOTES The DIRECTORY command cannot be used to print a hard copy You must load the disk directory destroying the program currently in memory to do that a To print out the DIRECTORY of drive 0 unit 8 use the following LOAD SO0 8 OPEN4 4 CMD4 LIST PRINT 4 CLOSE4 BUGS None None command DLOAD command DLOAD NAME DLOAD Loads a program from disk into a memory ABBREVIATION d lt shift gt L SYNOPSIS DLOAD lt file gt D lt drive gt U lt unit gt FUNCTION This command loads a program from disk into a memory Use LOAD to load programs on tape You must supply a file name INPUTS lt file gt file name and or pattern lt drive gt drive number lt unit gt drive unit number RESULT A program is loaded from disk into a memory EXAMPLES DLOAD DTRUCK Searches the disk for the program DTRUCK and LOADs it DLOAD AS LOADs a program from disk whose name is in the variable A You wil
97. the keyboard ABBREVIATION getk lt shift gt E SYNOPSIS GETKEY lt variable gt FUNCTION The GETKEY statement is vary similar to the GET statement Unlike the GET statement GETKEY waits for the user to type a character on the keyboard This lets it to be used easily to wait for a single character to be typed INPUTS lt variable gt acquired data will be stored in this variable RESULT Data acquired from the keyboard is stored in the target variable lt variable gt EXAMPLES 10 GETKEY AS This line waits for a key to be struck Typing any key will continue the program NOTES This command can only be executed within a program BUGS None statement GOSUB statement GOSUB NAME GOSUB Calls a subroutine ABBREVIATION go lt shift gt S SYNOPSIS GOSUB lt line gt FUNCTION This statement is like the GOTO statement except that your computer remembers where it came from When a line with a RETURN statement is ncountered the program jumps back to the statement immediately following the GOSUB The target of a GOSUB statement is called a subroutine A subroutine is useful if there is a routine in your program that can be used by several different portions of the program Instead of duplicating the section of program over and over you can set it up as a subroutine and GOSUB to it from the different parts of the program
98. turned off It starts at zero when computer is turned on and is reset to zero when the value of the clock exceeds 235959 23 hours 59 minutes and 59 seconds EXAMPLES TIS 101530 Sets the clock to 10 15 and 30 seconds AM NOTES None BASIC ERROR MESSAGES Thes rror messages are printed by BASIC You can also PRINT the messages through the use of the ERR function The error number refers only to the number assigned to the error for use with this function basic_error 01_TOO MANY FILES basic_error 01_TOO MANY FILI cal n NUMBER MESSAGE TOO MANY FILES DESCRIPTION There is a limit of 10 files OPEN at one time T basic_error 02_FILE_ OPEN basic_error 02_FILE_ OPEN MESSAGI FILE OPEN GI DESCRIPTION An attempt was made to open a file using the number of an already open file T basic_error 03_FILE_NOT_OPEN basic_error 03_FILE_NOT_OPEN MESSAGI FILE NOT OPEN GI DESCRIPTION The file number specified in an I O statement must be opened before us T basic_error 04 FILE NOT_ FOUND basic_error 04 FILE NOT_ FOUND 67 FILE NOT FOUND DESCRIPTION No file with that basic _error 05 DEVICE NOT PRES name exists d ENT NUMBER 5 MESSAGE DEVICE NOT PRESENT DESCRIPTION Leo basic_error 06_NOT_INPUT_FIL
99. ult string ULT String containing right most lt length gt characters of the string lt string gt PLES NOT None ES E 26 None BUGS None function RLUM NAME ABBREVIATION r lt shift gt L SYNOPSIS RLUM lt color _src gt FUNCTION a lt color_ src gt INPUTS lt color src gt color source 0 4 0 background 1 foreground 2 multicolor 1 3 multicolor 2 4 border RESULT EXAMPLES None NOTES function RND ABBREVIATION r lt shift gt N SYNOPSIS RND lt seed gt FUNCTION RND Generates a random number Returns current luminance 0 7 numeric function RLUM RLUM Returns color source s current luminance This function returns current luminance level assigned to color source function RND This function returns a random number between 0 and 1 This is useful in games to simulate dice rolls and other elements of change and is also used in some statistical applications generated by the formula RND TI time After this number If lt seed gt the same negativ INPUTS lt seed gt a seed RESULT EXAMPLES A random number between 0 and 1 100 X INT RND 1 6 INT RND 1 6 2 Simulates two 100 X INT RND 1 1000 1 Number from 1 dice 1000 The first random number should be to start things off differently every the number
100. utput EXAMPLES 10 OPEN 1 4 20 CMD 1 30 LIST 40 PRINT 1 50 CLOSE 1 Line 10 OPENs device number 4 which is the printer Line 20 All normal output now goes to the printer Line 30 The LISTing goes to the printer not the screen even th word READY Line 40 Set output back to the screen Line 50 Close the file NOTES None BUGS None None statement COLOR statement COLOR NAME COLOR Assigns a color to the color source ABBREVIATION co lt shift gt L SYNOPSIS COLOR lt color src gt lt color gt lt luminance gt FUNCTION Assigns a color to one of the 5 color sources 0 background 1 foreground 2 multicolor 1 3 multicolor 2 4 border Colors you can use are in the range 1 16 1 is black 2 is white 9 is orange etc from your keyboard color keys As an option you can include the luminance level 0 7 with 0 being lowest and 7 being highest Luminance defaults to 7 Luminance lets you select from eight levels of brightness for any color except black INPUTS lt color src gt color source 0 4 lt color gt color 1 16 lt luminance gt luminance 0 7 RESULT EXA Assigns a color to the color source PLES NOT BUG sta NAM ABB COLOR 1 1 ES E None S None None tement DATA statement DATA F E DATA Declares data items REVIATION 37 d lt shift gt A SYNOPSIS DATA lt item gt lt i
101. ves a rectangular graphic area into a string variable ABBREVIATION s lt shift gt S SYNOPSIS SSHAPE lt shape gt lt left gt lt top gt lt right gt lt bottom gt FUNCTION This statement is used to save a rectangular area of multicolor or high resolution screen using BASIC string variable Because BASIC limits string lengths to 255 characters the size of th 60 area you may save is limited The string size required can be calculated using one of the following unscaled formulas L mem INT lt left gt lt right gt 1 4 99 ABS lt top gt lt bottom gt 1 L h r INT lt left gt lt right gt 1 8 99 ABS lt top gt lt bottom gt 1 ABS ABS mcm refers to multi color mode h r is high resolution mode The shape is saved row by row The last four bytes of the string contain the column and row lengths less one i e ABS lt left gt lt right gt in low high byte format if scaled divide the lengths by 3 2 X and 5 12 Y INPUTS lt shape gt string variable where shape should be stored lt left gt scaled corner coordinate lt top gt scaled corner coordinate lt right gt scaled corner coordinate lt bottom gt scaled corner coordinate RESULT Saves a defined rectangular graphic area into a BASIC string variable EXAMPLES NOT SSHAPE VS 0 0 Saves screen area from the upper left corner to where t
102. when a file is being accessed that has not been opened in the DOS Sometimes in this case a message is not generated the request simply ignored T T disk_error 62_FILE_NOT FOUND disk_error 62_FILE NOT FOUND NUMBER 62 ea MESSAGI FILE NOT FOUND J ESCRIPTION The requested file does not exist on the indicated drive disk_error 63_FILE EXISTS disk_error 63_FILE_ EXISTS NUMBER 63 aail MESSAGI FILE EXISTS J ESCRIPTION The file name of the file being created already exists on the disk disk _error 64 FILE TYPE MISMATCH disk_error 64 FILE TYPE MISMATCH NUMBER 64 aai MESSAGI FILE TYPE MISMATCH 76 ESS RIPTION The file type does not match the file type in the directory entry for the requested fil _error 65 NO BLOCK disk_error 65 NO BLOCK ER 65 AGE iw ESC NO BLOCK RIPTION This message occurs in conjunction with the B A command It indicates that the block to be allocated has been previously allocated The parameters indicate the track and sector available with the next highest number If the parameters are zero 0 then all blocks higher in number are in use disk _error 66 ILLEGAL TRACK AND SECTOR disk_error 66 ILLEGAL TRACK AND SECTOR
Download Pdf Manuals
Related Search
Related Contents
ioLogik 1300 Series User`s Manual Gefen 4x4 VGA Matrix Mass Profiler Pro Quick Start F8.book NEC NP-UM330W Mechanical Drawings OPERATING INSTRUCTIONS AND SYSTEM DESCRIPTION OF D-Link DSL-504 Network Router User Manual AKG K323XS A Extron electronic Extron Electronics Switch SW YUV A User's Manual Août 2007 A school kid runs by. I tell him it`s electric. He says he knows Copyright © All rights reserved.
Failed to retrieve file