@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@P!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ` }$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF }7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L }EE !E^ ^ E E7EȩEdE/EȩE  D } .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `8  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV!}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh"}DEL8HI4 0 HI,0 0  9 .G VLO#},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D8:MEM.SAV J y08 B|DEHI$} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI%} VY8 B V  @  /DE `E:D8:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO &}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -'}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH(}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu } !  NAKEBQXYNPTTMR + @ *}  @3  dr;@,(>:A%,/-@@R(WHAT SCR+}EEN COLOR DO YOU WANT?^6-r6. nH( ( (( 1: NORMAL+(2: AMBER:(3: GREENH(4: GRE,}YxB A -@@4(SELECT A NUMBER8B BT  @)!@)P:,#(J("ERROR: SELECT A NU-}MBER FROM 1 TO 4T A ''APA`ApA1AAH'A @1 A1A.}@X'A 1 A1A@D'A 1 A1A@'A /}1 A}<;@0,;A0,;@,;@,;@,I(>:A%,[-@@ }(Documentatio0}n for TURBO BASIC1-@@1(PRESS ٠ TO SCROLL6-@@,(CREEN OR RINTER03(6(;;1}7@<@,4S)7@<@,4sAP;;7@<@,4P)7@<@,4pApMAR2}@ @M@@D1:TURBODOC.NEW( A@(6-%@("@ 3} AP" A`,5F:A,"A6#@5AR6,,($------------------------------------@4}( ** END **J0 6.,(DO YOU WANT TO PRINT IT(Y/N)0T$$7@<@,4YAp^$$7@5}<@,4NA`h +r;@;@@D1:TURBODOC.NEW|\(>:A%,"-@@6}X(0DID YOU SET PAPER TO THE TOP OF ITS FORM (Y/N)\$$7@<@,0YA3 3 330(>:A7}%,"-@@0( PRINTING!( Ap@(6-%@.@.@@P:8}&&(@ "@W A A @F:A,"A6#@.@@A9}R<6-6-@W&5-@+%@,83< ,,($------------------------------------::3$:} -%@-( ** END ** +??PROGRAM BY RON. FETZER, ;}22 MONACO AVE, ELMONT, N.Y. 11003&SCROLLING ROUTINE0##@@K::)@D"@:<} ,AN6-@$XPAGE ROUTINEb6-6-%@lQ(@(@Q(@$=} --v&-@@"(@& $D:MENU(@Q(@$e EXPANDED TURBO BASIC DOCUMENTATION ================================== by Ron. Fetzer This expanded docum?}entation isbased on the pioneering work of Daveand Laura Yearke of the Western NewYork Atari Users Group. The superb @}Turbo Basic by FrankOstrowski from Holland works only onthe Atari XL and Atari XE computers.It is completely compatible wiA}thATARI BASIC. In addition to theregular Atari Basic commands you get42 more commands and 22 morefunctions. You have a usB}eable RAM of34,021 bytes. This is 1,747 morebytes than Atari Basic. It runs 3times faster than Atari Basic and youhave a C}BASIC COMPILER that increasesthe speed 10 to 15 times more. The DOS commands are accessed inthe direct mode or the proD}grammedmode. There is no Turbo Basic DOS.You have new graphics commands notavailable before. Turbo Basic isinsensitive toE} upper or lower orinverse characters for most of itscommands. You can have 256 variablenames. This documentation trieF}s toprovide programming examples for thenew commands. There is an index atthe end of this documentation foreasy finding oG}f commands ** LOADING TURBO BASIC ** -------------------------- Turbo Basic gets loaded withouta cartridH}ge. 1. Turn on your diskdrive. 2. Insert the Turbo Basicdisk. 3. On the XE hold down theOPTION key and turn on the computeI}r. ** DISK COMMANDS ** ------------------- The DOS functions are accessedin the direct or the progrJ}ammed mode.There is no Turbo-DOS. If you typeDOS you are directed to DOS 2.5. Youare now out of Turbo Basic. It issuggestK}ed that you save your programfirst otherwise it is lost. You canget back into Turbo Basic by usingOPTION L on the DOS and L}typingAUTORUN.SYS for the file name. FORMAT: BLOAD "D:name" EXAMPLE: BLOAD "D:TEST.BIN" This command is uM}sed to loadbinary files. The file willautomatically load without having togive a memory address. It is justlike Option L N}with /N on DOS 2.0 FORMAT: BRUN "D:name" EXAMPLE: BRUN "D:COMPILER.COM" This is used to load and RUN amacO}hine language(Binary) file. Thefile will run automatically withouthaving to give a memory address. Itis the same as OptionP} L and Option Mon DOS 2.0 FORMAT: DELETE "D:name" (Wild cards are O.K.) EXAMPLE: DELETE "D:TEST.BQ}AS" DELETE "D8:test.bas" delete "D2:*.*" Delete "D2:TEST.???" 90 DELER}TE "D:*.*" This command erases from thedisk a file specified. The wild cardsymbols (*.* and ???) are permitted.The dS}evice name (D:) has to be incapital letters. Inverse file namesare not permitted. In the programmedmode it has to be the lT}ast item onthe line. This is the same as OptionD on DOS 2.0 FORMAT: DIR (Wild cards O.K.) EXAMPLE: DIR U} DIR "D:*.*" DIR "D2:*.BAS" DIR "D:???.*" DIR "D8:*.*" 90 DIR "V}D8:*.*" This command gives you the diskdirectory. Wild cards are permitted.In the programmed mode it has to bethe laW}st item on the line. This isthe same as Option A on DOS 2.0 FORMAT: RENAME "D:old name,new name" X}EXAMPLE: RENAME "D:FILE.OLD, FILE.NEW" RENAME "D8:*.TXT, *.BAS" This command Y}renames a file. Thefirst name is the OLD name, thesecond name is the NEW name. Thecomma between them is important. WildcaZ}rds are permitted. This is the sameas Option E on DOS 2.0 FORMAT: LOCK "D:name" EXAMPLE: LOCK "D:TEST.BAS" [} LOCK "D2:SCREEN.???" LOCK "D8:*.*" 90 LOCK "D:*.*" This command locks a file so y\}oucannot change it or erase it untilyou unlock it. Wild cards arepermitted. In the programmed mode ithas to be the last i]}tem on the line.This is the same as Option F on DOS2.0 FORMAT: UNLOCK "D:name" EXAMPLE: UNLOCK "D:TEST.BAS" ^} UNLOCK "D2:SCREEN.???" UNLOCK "D8:*.*" 10 UNLOCK "D:*.*" This command is the op_}posite of LOCK. It opens a file so it can bechanged. Wild cards are permitted. Inthe programmed mode it has to be thelast`} item on the line. This is thesame as Option G on DOS 2.0 ** MEMORY ** ------------ FORMAT: a} DPOKE m,v EXAMPLE: DPOKE 88,32750 90 DPOKE 88,32750 This command puts 2 bytes ofdata into 2 conseb}cutive memorylocations. In the example above atPOKE 88 and POKE 89 integer 32750 isstored. FORMAT: DPEEK(m) Ec}XAMPLE: ? DPEEK(88) 90 ? DPEEK(88) This is the opposite of DPOKE.It retrieves a 2 byte integer from 2cod}nsecutive locations. In the exampleabove at PEEK(88) and PEEK(89) FORMAT: MOVE m,m1,m2 EXAMPLE: MOVE 53248,3276e}8,1024 MOVE $D000,$8000,$400 This moves a whole block ofdata. The 'm' is the old address, the'm1' is thf}e new address and the 'm2'is the length of the data in bytes FORMAT: -MOVE m,m1,m2 EXAMPLE: -MOVE 53248,32768,1g}024 -MOVE $D000,$8000,$400 This is the same as above exceptit copies with the last byte of theblock h} FORMAT: BPUT #n,adr,len EXAMPLE: BPUT #3,ADR(B$), LEN(B$) EXAMPLE #2 100 CLS i} 110 GRAPHICS 5:ADDR=DPEEK(88) 120 PRINT " FILL THE SCREEN" 130 FOR X = 1 TO (20*40) 140 POKE ADDR+X,RAND(j}125) 150 NEXT X 160 ? "Now BPUT data onto RAMDISK D8:SCREEN" 170 CLOSE:OPEN #1,8,0,"D8: SCREk}EN" 180 BPUT #1,ADDR,20*40 190 CLOSE 200 ? "IT IS DONE!" 210 FOR Y= 1 TO 6000:NEXT Y 220 GRAPHICS 0l} This outputs a block of data toa device specified by the channelnumber(1-7). The block starts at'adr' and ends at 'm}len'. In theexample above we wrote to the RAMDISK the screen data under the filename "SCREEN". It can be recoveredwith BGn}ET. See the next command. FORMAT: BGET #n,adr,len EXAMPLE: BGET #3,ADR(B$), LEN(B$) o} EXAMPLE #2 100 CLS 110 GRAPHICS 5:ADDR=DPEEK(88) 120 CLOSE:OPEN #1,4,0, "D8:SCREEN" 130 ? "BGEp}T data from RAM DISK D8:'SCREEN'" 140 BGET #1,ADDR,20*40 150 CLOSE 160 FOR Y=1 TO 6000:NEXT Y 17q}0 GRAPHICS 0 BGET recovers a block of datasaved with BPUT. The '#n' is thechannel number(1-7), 'adr' is thememory adT} EXPANDED TURBO BASIC DOCUMENTATION ================================== by Ron. Fetzer This expanded docum s}entation isbased on the pioneering work of Daveand Laura Yearke of the Western NewYork Atari Users Group. Turbo Basic t} by Frank Ostrowskifrom Holland works only on the AtariXL and Atari XE computers. It iscompletely compatible with ATARIBA u}SIC. In addition to the regularAtari Basic commands you get 42 morecommands and 22 more functions. Youhave a useable RAM o v}f 34,021 bytes.This is 1,603 more bytes than AtariBasic. It runs 3 times faster thanAtari Basic and you have a BASICCOMPI w}LER that increases the speed 10to 15 times more. The DOS commands are accessed inthe direct mode or the programmedmod x}e. There is no Turbo Basic DOS.You have new graphics commands notavailable before. Turbo Basic isinsensitive to upper or l y}ower orinverse characters for most of itscommands. You can have 256 variablenames. This documentation tries toprovid z}e programming examples for thenew commands. ** LOADING TURBO BASIC ** -------------------------- Turbo B {}asic gets loaded withouta cartridge. 1. Turn on your diskdrive. 2. Insert the Turbo Basicdisk. 3. On the XE hold down the |}OPTION key and turn on the computer. ** DISK COMMANDS ** ------------------- The DOS functions are a }}ccessedin the direct or the programmed mode.There is no Turbo-DOS. If you typeDOS you are directed to DOS 2.5. Youare now ~} out of Turbo Basic. It issuggested that you save your programfirst otherwise it is lost. You canget back into Turbo Basic } by usingOPTION L on the DOS and typingAUTORUN.SYS for the file name. FORMAT: BLOAD "D:name" EXAMPLE: BLOAD "D }:TEST.BIN" This command is used to loadbinary files. The file willautomatically load without having togive a memory }address. It is justlike Option L with /N on DOS 2.0 FORAMT: BRUN "D:name" EXAMPLE: BRUN "D:COMPILER.COM" }This is used to load and RUN amachine language(Binary) file. Thefile will run automatically withouthaving to give a memory } address. Itis the same as Option L and Option Mon DOS 2.0 FORMAT: DELETE "D:name" (Wild cards are O.K }.) EXAMPLE: DELETE "D:TEST.BAS" DELETE "D8:test.bas" delete "D2:*.*" Delete " }D2:TEST.???" 90 DELETE "D:*.*" This command erases from thedisk a file specified. The wild cardsymbols }(*.* and ???) are permitted.The device name (D:) has to be incapital letters. Inverse file namesare not permitted. In the }programmedmode it has to be the last item onthe line. This is the same as OptionD on DOS 2.0 FORMAT: DIR (Wild card }s O.K.) EXAMPLE: DIR DIR "D:*.*" DIR "D2:*.BAS" DIR "D:???.*" D }IR "D8:*.*" 90 DIR "D8:*.*" This command gives you the diskdirectory. Wild cards are permitted.In the p }rogrammed mode it has to bethe last item on the line. This isthe same as Option A on DOS 2.0 FORMAT: RENAME "D:old n }ame,new name" EXAMPLE: RENAME "D:FILE.OLD, FILE.NEW" RENAME "D8:*.TXT, } *.BAS" This command renames a file. Thefirst name is the OLD name, thesecond name is the NEW name. Thecomma }between them is important. Wildcards are permitted. This is the sameas Option E on DOS 2.0 FORMAT: LOCK "D:name" } EXAMPLE: LOCK "D:TEST.BAS" LOCK "D2:SCREEN.???" LOCK "D8:*.*" 90 LOCK "D:*.*" } This command locks a file so youcannot change it or erase it untilyou unlock it. Wild cards arepermitted. In the progr }ammed mode ithas to be the last item on the line.This is the same as Option F on DOS2.0 FORMAT: UNLOCK "D:name" } EXAMPLE: UNLOCK "D:TEST.BAS" UNLOCK "D2:SCREEN.???" UNLOCK "D8:*.*" 10 UNLOCK "D }:*.*" This command is the opposite ofLOCK. It opens a file so it can bechanged. Wild cards are permitted. Inthe prog }rammed mode it has to be thelast item on the line. This is thesame as Option G on DOS 2.0 ** MEMORY ** } ------------ FORMAT: DPOKE m,v EXAMPLE: DPOKE 88,32750 90 DPOKE 88,32750 This command }puts 2 bytes ofdata into 2 consecutive memorylocations. In the example above atPOKE 88 and POKE 89 integer 32750 isstored }. FORMAT: DPEEK(m) EXAMPLE: ? DPEEK(88) 90 ? DPEEK(88) This is the opposite of DPOKE.It ret }rieves a 2 byte integer from 2consecutive locations. In the exampleabove PEEK(88) and PEEK(89) FORMAT: MOVE m,m1,m2 } EXAMPLE: MOVE $D000,$8000,$400 This moves a whole block ofdata. The 'm' is the old address, the'm1' is the new }address and the 'm2'is the lenght of the data in bytes FORMAT: -MOVE m,m1,m2 EXAMPLE: -MOVE $D000,$8000,$400 } This is the same as above exceptit copies with the last byte of theblock FORMAT: BPUT #n,adr,len EXAMPLE: }BPUT #3,ADR(B$), LEN(B$) EXAMPLE #2 100 CLS 110 GRAPHICS 5:ADDR=DPEEK(88) 120 PR }INT " FILL THE SCREEN" 130 FOR X = 1 TO (20*40) 140 POKE ADDR+X,RAND(125) 150 NEXT X 160 ? "Now BPUT d }ata onto RAMDISK D8:""SCREEN"" 170 CLOSE:OPEN #1,8,0,"D8: SCREEN" 180 BPUT #1,ADDR,20*40 19 }0 CLOSE 200 ? "IT IS DONE!" 210 FOR Y= 1 TO 6000:NEXT Y 220 GRAPHICS 0 This outputs a block of data toa } device specified by the channelnumber(1-7). The block starts at'adr' and ends at 'len'. In theexample above we wrote to t }he RAMDISK the screen data under the filename "SCREEN". It can be recoveredwith BGET. See the next command. FORMAT: } BGET #n,adr,len EXAMPLE: BGET #3,ADR(B$), LEN(B$) EXAMPLE #2 100 CLS 110 GRAPH }ICS 5:ADDR=DPEEK(88) 120 CLOSE:OPEN #1,4,0, "D8:SCREEN" 130 ? "BGET data from RAM DISK D8:""SCREE }N"" 140 BGET #1,ADDR,20*40 150 CLOSE 160 FOR Y=1 TO 6000:NEXT Y 170 GRAPHICS 0 BGET recovers a bloc }k of datasaved with BPUT. The '#n' is thechannel number(1-7), 'adr' is thememory address and 'len' is thelength of the da }ta. FORMAT: %PUT #n,a EXAMPLE: %PUT #1,A EXAMPLE #2 10 CLS 20 CLOSE:OPEN #1,8,0,"D8:TE }ST" 30 FOR X = 1 TO 5 40 INPUT "GIVE ME A NUMBER>",A 50 %PUT #1;A 60 NEXT X:CLOSE 70 ?:? "I have sav }ed the the numbers with %PUT to the RAM DISK under 'TEST'" 80 ?:?:DIR "D8:*.*" This is the same as } 'PRINT #1;A'except it is much faster and usesless memory. You must open a channelfor %PUT. See the demonstartionprogram }on the front of this disk.Use RUN "D:PUTDEMO.TUR". If you havea XL computer list the program andchange all referrences fro }m D8: toD1: and then run it. You can retrievethe numbers in EXAMPLE #2 by usingthe %GET program that follows. It isused w }ith NUMBERS only. FORMAT: %GET #n,a EXAMPLE: %GET #1,A EXAMPLE #2 10 CLS 20 CLOSE:OPEN } #1,4,0,"D8:TEST" 30 FOR Y = 1 TO 5 40 %GET #1;A 50 ? A 60 NEXT Y:CLOSE 70 ?:? "I have retrieved the } numbers saved with %PUT by using %GET" 80 LIST It retrieves the numbers savedwith %PUT. You must } have a channelopen. It is the same as 'INPUT #1;A'except it is much faster. ** GENENRAL PROGRAMMING ** ------- }-------------------- FORMAT: CLS EXAMPLE: CLS 10 CLS EXAMPLE #2 10 CLS } 20 FOR X=1 TO 50 30 ? " CLEAR SCREEN "; 40 NEXT X 50 GOTO 10 This command clears the screen.It is the }same as pressingCNTRL+CLEAR or ? CHR$(125) FORMAT: CLS #n(channels 1-7) EXAMPLE: CLS #3 90 CLS #3 } EXAMPLE #2 10 CLS 20 ?:?:?:?:?:?:? "THIS WILL NOT BE ERASED - IT IS BEFORE LINE 30( }OPEN). TO STOP -->'BREAK'" 30 CLOSE:OPEN #3,4,0,"K:" 40 CLS #3 50 ? "PRESS ANY KEY"; 60 GET #3,L } 70 ?:? "YOU PRESSED THE "; CHR$(L);" KEY":? 80 CLS #3 90 GOTO 40 This command clears the screen }of any information that was therebecause of the opened channel. Thisis different from CLS which clearsthe whole screen. } FORMAT: PAUSE n EXAMPLE: PAUSE 50 90 PAUSE 100 EXAMPLE #2 10 CLS 20 REPEAT }:A=A+1 30 ? A;", "; 40 PAUSE 100 50 UNTIL A=20 EXAMPLE #3 10 CLS 20 X=10 30 REP }EAT:A=A+1 40 ? A;", "; 50 PAUSE 10*X 60 UNTIL A=20 This command puts a time delayof about 1/50 of a sec }ond into yourprogram for each number. PAUSE 15 =about 15/50 of a second delay. It isthe same as 'FOR X = 1 TO 15:NEXT X'. }Computed values are allowed. Negativevalues are not allowed. FORMAT: RENUM n,i,j EXAMPLE: RENUM 10,100,10 } 90 RENUM 100,10,10 EXAMPLE #2 10 CLS 20 ? "RENUMBER PLEASE!" 30 PAUSE 100 40 LIS }T 50 RENUM 10,100,20 60 LIST EXAMPLE #3 10 CLS 20 X=3 30 ? " HELLO "; 40 GOTO X }*10 50 REM X*10 WILL NOT BE RENUMBERED 60 RENUM 10,100,20 70 LIST This command renumbers yourpr }ogram. The 'n' is the program linenumber that you want to startrenumbering with. The 'i' is thefirst NEW number. The 'j' i }s theincrement. It will not renumber linereferences which involve variables orcomputed values. See example #3. FORMA }T: DEL n,i EXAMPLE: DEL 60,100 90 DEL 50,80 EXAMPLE #2 10 CLS 20 ? "THIS LINE }STAYS" 30 ? "30 GOES" 40 ? "40 GOES" 50 ? "50 GOES" 60 DEL 30,50 70 LIST This command deletes }lines outof your program. 'n' = the startingnumber and 'i'= the ending number. Itcan be used in the direct orprogrammed m }ode. FORMAT: DUMP EXAMPLE: DUMP 90 DUMP EXAMPLE #2 10 CLS 20 DIM A$(35), }B(5) 30 A$="DUMP - VARIABLES AND THEIR VALUES" 40 REPEAT:X=X+1 50 INPUT "GIVE ME A NUMBER>",C 60 }B(X)=C:REM NUMBER ARRAY 70 UNTIL X=5 80 ? " NUMBERS" 90 FOR T = 1 TO 5 100 ? B(T) 110 NEXT T }120 ?:? A$ 130 DUMP This command dumps the variablesused and their values. For numericarrays the DUMed value wil }l be shownas: (B,6. The DUMPed value is theDIMed value +1. String values areshown with their length first andthen their D }IMed value. PROCEDUREnames and labels and their linevalues are also listed. The NEWcommand clears the DUMPed values.This }command can be used in thedirect or the programmed mode. FORMAT: DUMP name EXAMPLE: DUMP "P:" DUM }P "D8:VARIB" 90 DUMP "P:" EXAMPLE #2 10 CLS 20 DIM A$(40),B(5) 30 A$="DUMPed - V }ARIABLES" 40 FOR X = 1 TO 5 50 INPUT "GIVE ME A NUMBER>",C 60 B(X)=C:REM NUMBER ARRAY 70 NEXT X 80 F }OR Y = 1 TO 5 90 ? B(Y):LPRINT B(Y) 100 NEXT Y 110 LPRINT:LPRINT A$ 120 DUMP "P:" This command is t }he same asabove except we DUMP to a devicespecified. "P:" = printer or"D8:VARIB" = Ram Disk. For example #2turn on your p }rinter. This commandcan be used in the direct or theprogrammed mode. FORMAT: TRACE TRACE - EXAMP }LE: 10 TRACE 90 TRACE - EXAMPLE #2 10 TRACE 20 CLS 30 ?:? " TRACING" 40 R }EPEAT:A=A+1 50 ? A;", "; 60 UNTIL A=10 70 TRACE - 80 ?:? 90 ? " NO TRACING" 100 REPEAT:B=B+1 } 110 ? B;", "; 120 UNTIL B=10 This command tells you what lineis about to be executed. It is shownin [ ] on }the screen. The TRACE isthe way you turn it ON. The TRACE - is the way you turn it OFF. This isa great aid in de-bugging a } program. FORMAT: INPUT "text";a,b... INPUT "text",a,b... EXAMPLE: 20 INPUT "Numbers";A } 50 INPUT "Names";B$ 70 INPUT "Names &" Ages >>",A$,B 90 INPUT "ADDRESS >" } ,ADR$ EXAMPLE #2: 10 CLS 20 DIM A$(10) 30 ? "THIS WILL PRINT ?":? 40 FOR X } = 1 TO 3 50 INPUT "Names";A$ 60 NEXT X 70 ?:? 80 ? "No Symbol - Use your own" :? 90 FOR Y = } 1 TO 3 100 INPUT "Numbers >>",B 110 NEXT Y This command lets you use aprompt with the INPUT for easierprog }ramming. If you use a semicolonafter the prompt the usual '?' willbe printed. If you use a comma afterthe prompt nothing w }ill be printedand you have to include your ownsymbol with the prompt. See example#2. FORMAT: GO TO EXAMPLE: 5 }0 GO TO 20 GO TO 100 EXAMPLE #2 10 CLS 20 ? " HELLO "; 30 GO TO 20 This co }mmand is the same as theusual GOTO FORMAT: *L (DEFAULT) *L - EXAMPLE: 30 *L 90 *L - } EXAMPLE #2 10 CLS:? 20 *L 30 ? "LINE # 50-70 INDENT ON" 40 FOR X = 1 TO 5 50 ? " "; } 60 ? " "; 70 ? " "; 80 NEXT X 90 LIST 100 PAUSE 300 110 CLS:? 120 *L - 130 ? "LINE # } 50-70 INDENT OFF" 140 LIST When listing a program withloops this command either turns onthe indent on the loops } or turns themoff. The *L turns it ON. This is thenormal default condition. The *L - turns the indent OFF. This works not }only on the screen but also on theprinter. FORMAT: *F (or *F+) *F - EXAMPLE: 70 *F }90 *F - EXAMPLE #2 10 CLS 20 ? "ILLEGAL REVERSE LOOP":? 30 FOR X = 2 TO 1 40 ? X 50 }NEXT X 60 PAUSE 200 70 *F 80 ?:? "ILLEGAL LOOP - NO EXECUTION - '*F'" 90 FOR X = 2 TO 1 100 } ? X 110 NEXT X 120 PAUSE 200 130 LIST Atari Basic has a bug. It allowsexecution of an illegal reverse }loop.(FOR X=2 TO 1:? X:NEXT X). Thiscommand allows you to turn thisfeature off or on. *F or *F + turnsit OFF. *F - turns }the bug ON if youwant it. FORMAT: *B (or B+) *B - EXAMPLE: 90 *B 200 *B - } EXAMPLE #2 10 CLS:? 20 CLOSE:OPEN #1,8,0,"D8:TEST" 30 FOR X=1 TO 3 40 INPUT "GIVE ME A NUMBER";A } 50 %PUT #1;A 60 NEXT X:CLOSE 70 PAUSE 100:?:? 80 ? " I AM TRAPPING 'BREAK' KEY" 90 *B 10 }0 CLOSE:TRAP 180: OPEN #1,4,0,"D8:TEST" 110 ?:? 120 FOR Y = 1 TO 3 130 PAUSE 100 140 %GET #1;A } 150 ? A;" TRY BREAK KEY" 160 NEXT Y:CLOSE 170 END 180 REM TRAP 190 ?:? "BREAK KEY TRAPPED!" 200 }GOTO 90 This command lets you trap thebreak key so your program cannotaccidentally be stopped by hittingthe BREAK ke }y. This command workswith the TRAP command. The *B turnsit ON. The *B - truns it OFF. FORMAT: -- EXAMPLE: 10 - }- 90 -- EXAMPLE #2 10 -- 20 CLS 30 ? " 30 DASHES " 40 ? " HELLO " 50 - }- 60 LIST This command prints 30 dashesacross the screen or the page whenyou LIST your program. It can be usedt }o make your program listingclearer. FORMAT: DSOUND n,f,d,v DSOUND EXAMPLE: 10 DSOUND 1,72,12,8 } 90 DSOUND EXAMPLE #2 10 CLS 20 ?:? "PRESS 'RESET' TO STOP" 30 X = RAND(255) 4 }0 ? X;", "; 50 DSOUND 1,X,12,8 60 PAUSE 25 70 DSOUND 80 DSOUND 0,X,12,8 90 GOTO 30 This comman }d pairs channels forincreased frequency range.n=channels(0-3). f=frequency range(0-255). d=distortion(0-15) 10 and 14prod }uce pure tones. v=volume(0-15). 0is silent 15 is the laudest. DSOUNDturns all sound OFF. ** LINE LABELS ** } ------------------- FORMAT: # name EXAMPLE: 120 # END 120 # END_OF_FILE EXAM }PLE #2 10 CLS 20 CLOSE:OPEN #1,8,0,"D8:TEST" 30 REPEAT:X=X+%1 40 INPUT "GIVE ME A NUMBER";A 50 %PUT } #1,A 60 UNTIL X=%3 70 CLOSE 80 CLOSE:OPEN #1,4,0,"D8:TEST" 90 TRAP # END:%GET #1,A 100 ? A 110 } GOTO 90 120 # END:IF ERR=136 THEN CLOSE This command gives the linenumber that has the '#' the VARIABLELABEL th }at follows the '#'. Forexample: '120 # END' will now becomea VARIABLE LABEL and it will be inthe variable name table liste }d assuch (Use DUMP to see it). In example#2 see line #90 '90 TRAP # END...".It will go to line 120. This is thesame as if } we wrote '90 TRAP 120...'except it is clearer the first way.When there is an EOL error(136)channel #1 will be closed so n }o erroris printed. A better way would have been'120 # END_OF_FILE...' Theunderscore (_) is allowed invariables and } labels and makes forclearer listings. We would have abetter discription of WHERE and WHATthe program does if we had used }it.If you use line labels they can berenumbered. %1 and %3 in line 120 and150 are used because they save us 6bytes each a }nd stand for the number 1and 3. See dicussion on constants. FORMAT: GO# name EXAMPLE: 60 GO# GET_KEY } 100 GO# ERROR EXAMPLE #2 10 CLS 20 ?:? "PRESS ANY KEY" 30 CLOSE:OPEN #1,4,0,"K:" 40 # } GET_KEY:GET #1,A 50 ? CHR$(A);", "; 60 GO# GET_KEY This is the same as GOTO exceptthe GO# looks for a label }. You cannothave a space between the GO and #.For the (_) in line 40 see '# name'above. Line 40 has the variable labelof }'# GET_KEY'. Line 60 looks forthis label and it works just like aGOTO except the listing is clearer. * MODIFICATION OF AT }ARI COMMANDS * ---------------------------------- FROMAT: CLOSE EXAMPLE: 90 CLOSE 120 CLOSE: } OPEN #1,4,0,"D8:TEST" This command closes ALL openedchannels. It is a good practice toclose a channel first } before openingit. This command is the same as 'FORX=1 TO 7:CLOSE X:NEXT X' FORMAT: DIM a(n) EXAMPLE: 10 DIM A }(6) 30 DIM B$(20) This command automaticallyassigns a value of 0 to all elementsin a numeric array and }nullcharacters to all elements of astring. The LEN function is stillvariable and initially 0 FORMAT: GET name } EXAMPLE: 20 GET A 90 GET KEY_PRESS EXAMPLE #2 10 CLS:?:? 20 GET A 30 ? "The key } is ";CHR$(A); 40 ? " the ATASCII = ";A 50 GOTO 20 This command returns the ATASCIIvalue of the key pressed. } It is thesame as 'OPEN #1,4,0,"K:":GET#1;A:CLOSE #1'. The command waits fora key press and assigns the ATASCIIvalue to t }he variable. FORMAT: LIST n, EXAMPLE: LIST 90, This command list the programfrom the line specified to it }s endprovided the comma is used. FORMAT: ON a EXEC n1,n2,... EXAMPLE: 30 ON X EXEC START, MAIN_PR }OG,ENDING This command is the same as'ON...GOSUB' except it is used withPROCEDURE. The command executes thePROCEDURE }S named. Instead of 'ON XGOSUB 200,300,400' we use variablelabel names of the PROCEDURES. SeePROCEDURE FORMAT: ON a } GO# n1,n2,... EXAMPLE: 70 ON X GO# NORMAL, UPSIDE_DOWN EXAMPLE #2 10 CLS:DIM A$(1) } 20 ?:? 30 INPUT "Normal or Upside down";A$ 40 IF A$(1,1)="N" THEN X=1 50 IF A$(1,1)<>"N" THEN X=2 } 60 ?:? 70 ON X GO# NORMAL,UPSIDE_DOWN 80 # NORMAL 90 POKE 755,2 100 ? "THIS IS PRINTED NOR }MALLY" 110 GOTO 20 120 # UPSIDE_DOWN:CLS 130 POKE 755,7:?:? 140 ? "THIS IS PRINTED UPSIDE DOWN" } 150 PAUSE 200:POKE 755,2 160 GOTO 20 This command is the same asON...GOTO except we use variablelabel names } instead of line numbers.In example #2 see line 70. FORMAT: POP EXAMPLE: 100 POP EXAMPLE #2 } 10 CLS:?:? 20 GOSUB 50 30 ? "I am the next line" 40 END 50 REM SUBROUTINE 60 POP 70 GOTO 90 } 80 RETURN 90 ? "I POPPED the RETURN line 30" 100 LIST The POP command will work withall 4 loops, } the DO-LOOP, WHILE-WEND,FOR-NEXT and GOSUB. When TURBO BASICsees a DO, WHILE, FOR or GOSUB itsaves its RETURN address on }theruntime stack so it knows to whatline to return to. If you want BASICto 'FORGET' this return line use POP.Too many POP }s can lead to errors andmake for poor programming. FORMAT: PUT n EXAMPLE: 60 PUT A EXAMPLE #2 } 10 REM SIMPLE WORDPROCESSOR 20 CLS:? 30 OPEN #1,4,0,"K:" 40 GET #1;A:R=R+1 50 IF R=37 THEN ? CHR$(155 }):R=0 60 PUT A 70 GOTO 40 This command is the same as'PRINT CHR$(A)';. It takes theATASCII number and conve }rts it into acharacter. FORMAT: RESTORE #name EXAMPLE: 120 RESTORE #AGAIN 160 RESTORE #NUM_AGAIN } EXAMPLE #2 10 CLS:? 20 DATA 1,2,3,4,5 30 # AGAIN 40 DATA 6,7,8,9,0 50 READ A 60 } IF A=0 THEN 100 70 ? A;", "; 80 PAUSE 10 90 GOTO 50 100 ?:? "NOW DIONG LN 40 DATA AGAIN" 11 }0 PAUSE 120 RESTORE #AGAIN 130 READ A 140 IF A=0 THEN 170 150 ? A;", "; 160 GOTO 130 170 ?:LIST } This command moves the datapointer back to the variable label inthe DATA chain. In example #2 theRESTORE printed on }ly the numbers inDATA ln. 40 because it came after '30#AGAIN'. It did not start with ln.#20. It is the same as RESTORE 40 !}except we use a variable label forclearer programming. The 0 was theflag. When the READ saw a 0 the theIF-THEN came in and "} directed it tosome other line. FORMAT: RND EXAMPLE: 20 RND 40 X=RND 90 X=INT(RND*1 #}0) 100 X=INT(RND*10)+1 200 X=INT(RND*100) EXAMPLE #2 10 X=RND 20 ? X;", $} "; 30 GOTO 10 EXAMPLE #3 10 CLS:? 20 X=INT(RND*10) 30 PAUSE 25 40 GOTO 20 In %}this command the dummyvariable (0) has been eliminated. Youcan still use the ATARI way RND(0) ifyou want to. In the exampl &}e ln. 90you get random numbers from 0-9. Inln. 100 you get random numbers 1-9.In ln 200 you get random numbers 0-99 '} FORMAT: RAND(n) EXAMPLE: 10 RAND(10) 30 RAND(100) EXAMPLE #2 10 CLS 20 X=RAND (}(100) 30 ? X;", "; 40 PAUSE 25 50 GOTO 20 In this command the randomnumbers are printed as integers. Th )}eystart with 1 and end with the numberin the parentheses. FORMAT: SOUND EXAMPLE: 90 SOUND EXAM *}PLE #2 10 R=R+1 20 Y=RAND(255) 30 SOUND 0,Y,10,8 40 PAUSE 100 50 SOUND 60 X=RAND(255) 70 +}SOUND 1,X,12,8 80 PAUSE 50 90 SOUND 100 IF R=8 THEN SOUND: R=0:GOTO 120 110 GOTO 10 120 END ,} This command turns all soundsoff. It is the same as 'SOUND0,0,0,0' FORMAT: TRAP #name EXAMPLE: 90 TRAP -}#END 95 TRAP #END_OF_FILE This command is the same as '90TRAP 150' except it uses variablelabel names. .}For an application seeexample #2 on the command '#name' ** STRINGS AND ERRORS ** -------------------------- /} FORMAT: TIME EXAMPLE: 90 ? TIME 95 ? TIME/60 EXAMPLE #2 10 CLS:?:? 20 ? "T 0}IMING A LOOP":?:? 30 S=TIME:REM STARTING TIME 40 FOR X=1 TO 120:? X;", ";: NEXT X 50 E=(TIME-S)/60:REM 1} E=ELAPSED TIME-S STARTING TIME 60 ?:?:? INT(E*100)/100; " SECONDS" The TIME counter is active as 2}soon as you turn on your computer. Itcounts 60 numbers per second. To geta readout in seconds use TIME/60. Toget a readout 3} in minutes useTIME/3600. to get a readout in hoursuse TIME/216000. The TIME counterwill continue as long as yourcomputer 4} is turned on. If you want tostart the time counter from thebeginning then press the RESETbutton. FORMAT: TIME$ 5} EXAMPLE: 30 ? TIME$ EXAMPLE #2 10 CLS:?:? 20 DIM T$(6) 30 INPUT "SET TIME - HHMMSS"; 6} T$:? 40 INPUT "WHEN TO STOP - HHMMSS";S 50 CLS 60 TIME$=T$ 70 REPEAT 80 POKE 755,0:REM NO 7} CURSOR 90 POSITION 10,10:? "HOURS,MIN, SEC:";:? TIME$ 100 X=VAL(TIME$) 110 UNTIL X=S 120 POSITIO 8}N 10,12:? "RING! RING! RING!" 130 POKE 755,3:REM CURSOR This command prints the time ofday in the form o 9}f HOUR MINUTE SECOND(HHMMSS). In Europe they use 50 cyclecurrent and European ATARI'S run onthis current as against 60 cyc :}les inthe USA. As a result of this theTIME$ function is not accurate andgains 12 minutes each hour. FORMAT: INKEY$ ;} EXAMPLE: 70 ? INKEY$ 90 A$=INKEY$ EXAMPLE #2 10 REM SCREEN WRITER 20 ? INKEY$; <} 30 GOTO 20 EXAMPLE #3 10 CLS:DIM A$(1):?:?:REM GAME 20 ? "HIT THE KEY OF THE LETTER O =}N THE SCREEN!" 30 PAUSE 150 40 R=RAND(90):IF R<65 THEN 40 50 CLS:POSITION 19,12: ? CHR$(R) 60 PAU >}SE 55 70 A$=INKEY$ 80 IF A$=CHR$(R):GOTO 90: ELSE:GOTO 100:ENDIF 90 ?:? "YOU GOT IT!":PAUSE 90: ?} GOTO 40 100 ?:? "YOU MISSED IT!": PAUSE 90:GOTO 40 This command returns thecharacter of the last key th @}at waspressed. In example #3 please noteline 70. Line 80 uses an IF-ELSE-ENDIF command. FORMAT: INSTR(x$,a$,i) A} EXAMPLE: 50 ? INSTR(X$,A$,1) EXAMPLE #2 10 DIM X$(30),A$(5) 20 X$="MY HEART BELONGS TO DA B}DDY" 30 A$="DADDY" 40 ? "DADDY IS AT POSIT. "; 50 ? INSTR(X$,A$,1) This command returns thebeginning of C} a sub string. The x$ =the original string. The a$ = the substring you want to find. The i = theposition in numeric form t D}hat youwant to start to search the originalstring. This command will return athe position number where the substring star E}ts. Spaces are alsocounted. FORMAT: UINSTR(x$,a$) UINSTR(x$,a$,i) EXAMPLE: 50 ? UINSTR(X$,A$) F} 50 ? UINSTR(X$,A$,5) EXAMPLE #2 10 DIM X$(40),A$(8) 20 X$="WHERE HAVE ALL THE SO G}DLIERS GONE" 30 A$="soldiers" 40 ? "soldiers IS AT POSIT"; 50 ? UINSTR(X$,A$) EXAMPLE #3 H}10 DIM X$(40),A$(8) 20 X$="ICH BIN EIN BERLINER" 30 A$="berliner" 40 ? "berliner IS AT POSIT."; 50 ? UINS I}TR(X$,A$,5) This command is the same asINSTR above. It searches for thebeginning of a sub string.x$=original string. J} a$=sub string.i=starting position of the search.With the UINSTR you can have lowercase, upper case or inverse as thesub K}string. It does not distinguishbetween case. You can include oreliminate the starting position ofthe search. See example # L}2 and #3. FORMAT: ERR EXAMPLE: 20 ? ERR 90 ? "ERROR # ";ERR; " AT LINE ";E M}RL EXAMMPLE #3 10 CLS:DIM A$(15):?:? 20 TRAP 90:READ A$ 30 ? A$ 40 GOTO 20 50 DATA M N}ONDAY,TUESDAY, WEDNESDAY 60 DATA THURSDAY,FRIDAY 70 DATA SATRUDAY,SUNDAY 90 REM ERROR TRAP ROUTINE O} 100 ?:? "ERROR # ";ERR; " AT LINE ";ERL 110 LIST DPEEK(186):REM LIST ERROR LINE This command l P}ist the last errornumber FORMAT: ERL EXAMPLE: 20 ? ERL 90 ? "ERROR # ";ERR; " A Q}T LINE ";ERL This command print the linewhere the last error occurred. Seeexample #3 at 'ERR" " A hEiͩkΩ͙kCop j`j {j`Hi͝Νh`S}L"UNEM:D"NURͩkΩ͙kCop j`j {j`Hi͝Νh`dress and 'len' is thelength of the data. FORMAT: %PUT #n,a EXAMPLE: %PUT #1,A EXAMPLE #2 1U}0 CLS 20 CLOSE:OPEN #1,8,0,"D8:TEST" 30 FOR X = 1 TO 5 40 INPUT "GIVE ME A NUMBER>",A 50 %PUT #1;A 6V}0 NEXT X:CLOSE 70 ?:? "I have saved the the numbers with %PUT to the RAM DISK under 'TEST'" 80 ?:?:W}DIR "D8:*.*" This is the same as 'PRINT #1;A'except it is much faster and usesless memory. You must open a channelfoX}r %PUT. See the demonstrationprogram on the front of this disk.Use RUN "D:PUTGET.TUR". If you have aXL computer list the pY}rogram andchange all references from D8: toD1: and then run it. You can retrievethe numbers in EXAMPLE #2 by usingthe %GEZ}T program that follows. It isused with NUMBERS only. FORMAT: %GET #n,a EXAMPLE: %GET #1,A EXAMPL[}E #2 10 CLS 20 CLOSE:OPEN #1,4,0,"D8:TEST" 30 FOR Y = 1 TO 5 40 %GET #1;A 50 ? A 60 NEXT Y:CLO\}SE 70 ?:? "I have retrieved the numbers saved with %PUT by using %GET" 80 LIST It retrieves t]}he numbers savedwith %PUT. You must have a channelopen. It is the same as 'INPUT #1;A'except it is much faster. ** ^}GENERAL PROGRAMMING ** --------------------------- FORMAT: CLS EXAMPLE: CLS 10 CLS _} EXAMPLE #2 10 CLS 20 FOR X=1 TO 50 30 ? " CLEAR SCREEN "; 40 NEXT X 50 GOTO 10 This co`}mmand clears the screen.It is the same as pressingCNTRL+CLEAR or ? CHR$(125) FORMAT: CLS #n(channels 1-7) EXAa}MPLE: CLS #3 90 CLS #3 EXAMPLE #2 10 CLS 20 ?:?:?:?:?:?:? "THIS WILL NOT BE Eb}RASED - IT IS BEFORE LINE 30(OPEN). TO STOP -->'BREAK'" 30 CLOSE:OPEN #3,4,0,"K:" 40 CLS #3 50c} ? "PRESS ANY KEY"; 60 GET #3,L 70 ?:? "YOU PRESSED THE "; CHR$(L);" KEY":? 80 CLS #3 90 GOTO 40d} This command clears the screenof any information that was therebecause of the opened channel. Thisis different from e}CLS which clearsthe whole screen. FORMAT: PAUSE n EXAMPLE: PAUSE 50 90 PAUSE 100 Ef}XAMPLE #2 10 CLS 20 REPEAT:A=A+1 30 ? A;", "; 40 PAUSE 100 50 UNTIL A=20 EXAMPLE #3g} 10 CLS 20 X=10 30 REPEAT:A=A+1 40 ? A;", "; 50 PAUSE 10*X 60 UNTIL A=20 This command putq} b%DOS SYSb*DUP SYSb)MENU CrTURBODOCNEWbRAUTORUN SYSbi>TURBODOCNEWb RAMDISK COM MODLUE TXTs a time delayof about 1/60 of a second into yourprogram for each number. PAUSE 60 =about 60/60 or 1 second delay. It istr}he similar to 'FOR X = 1 TO 60:NEXTX'. Computed values are allowed.Negative values are not allowed. FORMAT: RENUM n,s}i,j EXAMPLE: RENUM 10,100,10 90 RENUM 100,10,10 EXAMPLE #2 10 CLS 20 ? "RENUMBERt} PLEASE!" 30 PAUSE 100 40 LIST 50 RENUM 10,100,20 60 LIST EXAMPLE #3 10 CLS 20 u}X=3 30 ? " HELLO "; 40 GOTO X*10 50 REM X*10 WILL NOT BE RENUMBERED 60 RENUM 10,100,20 70 LIv}ST This command renumbers yourprogram. The 'n' is the program linenumber that you want to startrenumbering with. Thew} 'i' is thefirst NEW number. The 'j' is theincrement. It will not renumber linereferences which involve variables orcompux}ted values. See example #3. FORMAT: DEL n,i EXAMPLE: DEL 60,100 90 DEL 50,80 EXAMPLy}E #2 10 CLS 20 ? "THIS LINE STAYS" 30 ? "30 GOES" 40 ? "40 GOES" 50 ? "50 GOES" 60 DEL 30,50 z} 70 LIST This command deletes lines outof your program. 'n' = the startingnumber and 'i'= the ending number. Itca{}n be used in the direct orprogrammed mode. FORMAT: DUMP EXAMPLE: DUMP 90 DUMP EXAM|}PLE #2 10 CLS 20 DIM A$(35),B(5) 30 A$="DUMP - VARIABLES AND THEIR VALUES" 40 REPEAT:X=X+1 }}50 INPUT "GIVE ME A NUMBER>",C 60 B(X)=C:REM NUMBER ARRAY 70 UNTIL X=5 80 ? " NUMBERS" 90 FOR T = 1 TO ~}5 100 ? B(T) 110 NEXT T 120 ?:? A$ 130 DUMP This command dumps the variablesused and their values.} For numericarrays the DUMPed value will be shownas: (B,6. The DUMPed value is theDIMed value +1. String values areshown }with their length first andthen their DIMed value. PROCEDUREnames and labels and their linevalues are also listed. The NEW}command clears the DUMPed values.This command can be used in thedirect or the programmed mode. FORMAT: DUMP name } EXAMPLE: DUMP "P:" DUMP "D8:VARIB" 90 DUMP "P:" EXAMPLE #2 10 CLS 2}0 DIM A$(40),B(5) 30 A$="DUMPed - VARIABLES" 40 FOR X = 1 TO 5 50 INPUT "GIVE ME A NUMBER>",C 60 B(X)=C:R}EM NUMBER ARRAY 70 NEXT X 80 FOR Y = 1 TO 5 90 ? B(Y):LPRINT B(Y) 100 NEXT Y 110 LPRINT:LPRINT A$ } 120 DUMP "P:" This command is the same asabove except we DUMP to a devicespecified. "P:" = printer or"D8:VARIB" =} Ram Disk. For example #2turn on your printer. This commandcan be used in the direct or theprogrammed mode. FORMAT: } TRACE TRACE - EXAMPLE: 10 TRACE 90 TRACE - EXAMPLE #2 10 TRACE 2}0 CLS 30 ?:? " TRACING" 40 REPEAT:A=A+1 50 ? A;", "; 60 UNTIL A=10 70 TRACE - 80 ?:? 90 }? " NO TRACING" 100 REPEAT:B=B+1 110 ? B;", "; 120 UNTIL B=10 This command tells you what lineis abou}t to be executed. It is shownin [ ] on the screen. The TRACE isthe way you turn it ON. The TRACE - is the way you turn it }OFF. This isa great aid in de-bugging a program. FORMAT: INPUT "text";a,b... INPUT "text >",a,b... } EXAMPLE: 20 INPUT "Numbers";A 50 INPUT "Names";B$ 70 INPUT "Names &" Ages >>",}A$,B 90 INPUT "ADDRESS >" ,ADR$ EXAMPLE #2: 10 CLS 20 DIM A$(10) } 30 ? "THIS WILL PRINT ?":? 40 FOR X = 1 TO 3 50 INPUT "Names";A$ 60 NEXT X 70 ?:? 80 ? "No Symbol }- Use your own" :? 90 FOR Y = 1 TO 3 100 INPUT "Numbers >>",B 110 NEXT Y This command lets you u}se aprompt with the INPUT for easierprogramming. If you use a semicolonafter the prompt the usual '?' willbe printed. If }you use a comma afterthe prompt nothing will be printedand you have to include your ownsymbol with the prompt. See example}#2. FORMAT: GO TO EXAMPLE: 50 GO TO 20 GO TO 100 EXAMPLE #2 10 CLS 20 ?} " HELLO "; 30 GO TO 20 This command is the same as theusual GOTO FORMAT: *L (DEFAULT) *L -} EXAMPLE: 30 *L 90 *L - EXAMPLE #2 10 CLS:? 20 *L 30 ? "LINE # 50-70 INDENT }ON" 40 FOR X = 1 TO 5 50 ? " "; 60 ? " "; 70 ? " "; 80 NEXT X 90 LIST 100 PAUSE 300 1}10 CLS:? 120 *L - 130 ? "LINE # 50-70 INDENT OFF" 140 LIST When listing a program withloops this comman}d either turns onthe indent on the loops or turns themoff. The *L turns it ON. This is thenormal default condition. The *L} - turns the indent OFF. This works notonly on the screen but also on theprinter. FORMAT: *F (or *F+) } *F - EXAMPLE: 70 *F 90 *F - EXAMPLE #2 10 CLS 20 ? "ILLEGAL REVERSE LOOP":? } 30 FOR X = 2 TO 1 40 ? X 50 NEXT X 60 PAUSE 200 70 *F 80 ?:? "ILLEGAL LOOP - NO EXECUTION} - '*F'" 90 FOR X = 2 TO 1 100 ? X 110 NEXT X 120 PAUSE 200 130 LIST Atari Basic has a bug. I}t allowsexecution of an illegal reverse loop.(FOR X=2 TO 1:? X:NEXT X). Thiscommand allows you to turn thisfeature off or} on. *F or *F + turnsit OFF. *F - turns the bug ON if youwant it. FORMAT: *B (or B+) *B - EXAMPL}E: 90 *B 200 *B - EXAMPLE #2 10 CLS:? 20 CLOSE:OPEN #1,8,0,"D8:TEST" 30 FOR X=1 }TO 3 40 INPUT "GIVE ME A NUMBER";A 50 %PUT #1;A 60 NEXT X:CLOSE 70 PAUSE 100:?:? 80 ? " I AM TRAPPIN}G 'BREAK' KEY" 90 *B 100 CLOSE:TRAP 180: OPEN #1,4,0,"D8:TEST" 110 ?:? 120 FOR Y = 1 TO }3 130 PAUSE 100 140 %GET #1;A 150 ? A;" TRY BREAK KEY" 160 NEXT Y:CLOSE 170 END 180 REM TRAP } 190 ?:? "BREAK KEY TRAPPED!" 200 GOTO 90 This command lets you trap thebreak key so your program cannotaccide}ntally be stopped by hittingthe BREAK key. This command workswith the TRAP command. The *B turnsit ON. The *B - turns it O}FF. FORMAT: -- EXAMPLE: 10 -- 90 -- EXAMPLE #2 10 -- 20 CLS 30 ? " }30 DASHES " 40 ? " HELLO " 50 -- 60 LIST This command prints 30 dashesacross the screen or the page whe}nyou LIST your program. It can be usedto make your program listingclearer. FORMAT: DSOUND n,f,d,v DSO}UND EXAMPLE: 10 DSOUND 1,72,12,8 90 DSOUND EXAMPLE #2 10 CLS 20 ?:? "PRESS 'RES}ET' TO STOP" 30 X = RAND(255) 40 ? X;", "; 50 DSOUND 1,X,12,8 60 PAUSE 25 70 DSOUND 80 DSOUND 0},X,12,8 90 GOTO 30 This command pairs channels forincreased frequency range.n=channels(0-3). f=frequency range(0}-255). d=distortion(0-15) 10 and 14produce pure tones. v=volume(0-15). 0is silent 15 is the loudest. DSOUNDturns all soun}d OFF. ** LINE LABELS ** ------------------- FORMAT: # name EXAMPLE: 120 # END } 120 # END_OF_FILE EXAMPLE #2 10 CLS 20 CLOSE:OPEN #1,8,0,"D8:TEST" 30 REPEAT:X=X+%1 4}0 INPUT "GIVE ME A NUMBER";A 50 %PUT #1,A 60 UNTIL X=%3 70 CLOSE 80 CLOSE:OPEN #1,4,0,"D8:TEST" 90 T}RAP # END:%GET #1,A 100 ? A 110 GOTO 90 120 # END:IF ERR=136 THEN CLOSE This command gives the linenumb}er that has the '#' the VARIABLELABEL that follows the '#'. Forexample: '120 # END' will now becomea VARIABLE LABEL and it} will be inthe variable name table listed assuch (Use DUMP to see it). In example#2 see line #90 '90 TRAP # END...".It wi}ll go to line 120. This is thesame as if we wrote '90 TRAP 120...'except it is clearer the first way.When there is an EOL }error(136)channel #1 will be closed so no erroris printed. A better way would have been'120 # END_OF_FILE...' Theu}nderscore (_) is allowed invariables and labels and makes forclearer listings. We would have abetter description of WHERE }and WHATthe program does if we had used it.If you use line labels they can berenumbered. %1 and %3 in line 30 and60 are u}sed because they save us 6bytes each and stand for the number 1and 3. See dicussion on constants. FORMAT: GO# name} EXAMPLE: 60 GO# GET_KEY 100 GO# ERROR EXAMPLE #2 10 CLS 20 ?:? "PRESS ANY KEY" } 30 CLOSE:OPEN #1,4,0,"K:" 40 # GET_KEY:GET #1,A 50 ? CHR$(A);", "; 60 GO# GET_KEY This is the same as} GOTO exceptthe GO# looks for a label. You cannothave a space between the GO and #.For the (_) in line 40 see '# name'abo}ve. Line 40 has the variable labelof '# GET_KEY'. Line 60 looks forthis label and it works just like aGOTO except the list}ing is clearer. * MODIFICATION OF ATARI COMMANDS * ---------------------------------- FORMAT: CLOSE EXAMPLE: }90 CLOSE 120 CLOSE: OPEN #1,4,0,"D8:TEST" This command closes ALL openedchannels. It is a }good practice toclose a channel first before openingit. This command is the same as 'FORX=1 TO 7:CLOSE X:NEXT X' FOR}MAT: DIM a(n) EXAMPLE: 10 DIM A(6) 30 DIM B$(20) This command automaticallyassigns a value of 0 t}o all elementsin a numeric array and nullcharacters to all elements of astring. The LEN function is stillvariable and ini}tially 0 FORMAT: GET name EXAMPLE: 20 GET A 90 GET K EXAMPLE #2 10 CLS:?:? } 20 GET A 30 ? "The key is ";CHR$(A); 40 ? " the ATASCII = ";A 50 GOTO 20 This command returns the ATA}SCIIvalue of the key pressed. It is thesame as 'OPEN #1,4,0,"K:":GET#1;A:CLOSE #1'. The command waits fora key press and }assigns the ATASCIIvalue to the variable. FORMAT: LIST n, EXAMPLE: LIST 90, This command list the program}from the line specified to its endprovided the comma is used. FORMAT: ON a EXEC n1,n2,... EXAMPLE: 30 ON X EXEC} START, MAIN_PROG,ENDING This command is the same as'ON...GOSUB' except it is used withPROCEDURE. The c}ommand executes thePROCEDURES named. Instead of 'ON XGOSUB 200,300,400' we use variablelabel names of the PROCEDURES. See}PROCEDURE FORMAT: ON a GO# n1,n2,... EXAMPLE: 70 ON X GO# NORMAL, UPSIDE_DOWN EXAMP}LE #2 10 CLS:DIM A$(1) 20 ?:? 30 INPUT "Normal or Upside down";A$ 40 IF A$(1,1)="N" THEN X=1 } 50 IF A$(1,1)<>"N" THEN X=2 60 ?:? 70 ON X GO# NORMAL,UPSIDE_DOWN 80 # NORMAL 90 POKE 755,2 100 ? }"THIS IS PRINTED NORMALLY" 110 GOTO 20 120 # UPSIDE_DOWN:CLS 130 POKE 755,7:?:? 140 ? "THIS IS P}RINTED UPSIDE DOWN" 150 PAUSE 200:POKE 755,2 160 GOTO 20 This command is the same asON...GOTO excep}t we use variablelabel names instead of line numbers.In example #2 see line 70. FORMAT: POP EXAMPLE: 100 POP} EXAMPLE #2 10 CLS:?:? 20 GOSUB 50 30 ? "I am the next line" 40 END 50 REM SUBROUTINE} 60 POP 70 GOTO 90 80 RETURN 90 ? "I POPPED the RETURN line 30" 100 LIST The POP command} will work withall 4 loops, the DO-LOOP, WHILE-WEND,FOR-NEXT and GOSUB. When TURBO BASICsees a DO, WHILE, FOR or GOSUB it}saves its RETURN address on theruntime stack so it knows to whatline to return to. If you want BASICto 'FORGET' this retur}n line use POP.Too many POPs can lead to errors andmake for poor programming. FORMAT: PUT n EXAMPLE: 60 PUT 90} 20 PUT 89,69,83 EXAMPLE #2 10 REM SIMPLE WORDPROCESSOR 20 CLS:? 30 OPEN #1,4,0,"}K:" 40 GET #1;A:R=R+1 50 IF R=37 THEN ? CHR$(155):R=0 60 PUT A 70 GOTO 40 This command is the same }as'PRINT CHR$(A)';. It takes theATASCII number and converts it into acharacter. FORMAT: RESTORE #name EXAMPLE}: 120 RESTORE #AGAIN 160 RESTORE #NUM_AGAIN EXAMPLE #2 10 CLS:? 20 DATA 1,2,3,4,5 } 30 # AGAIN 40 DATA 6,7,8,9,0 50 READ A 60 IF A=0 THEN 100 70 ? A;", "; 80 PAUSE 10 90 GOTO 50} 100 ?:? "NOW DOING LN 40 DATA AGAIN" 110 PAUSE 120 RESTORE #AGAIN 130 READ A 140 IF A=0 THE}N 170 150 ? A;", "; 160 GOTO 130 170 ?:LIST This command moves the datapointer back to the variable lab}el inthe DATA chain. In example #2 theRESTORE printed only the numbers inDATA ln. 40 because it came after '30#AGAIN'. It} did not start with ln.#20. It is the same as RESTORE 40except we use a variable label forclearer programming. The 0 was t}heflag. When the READ saw a 0 then theIF-THEN came in and directed it tosome other line. FORMAT: RND EXAMPLE:} 20 RND 40 X=RND 90 X=INT(RND*10) 100 X=INT(RND*10)+1 200 X=INT(RND*1}00) EXAMPLE #2 10 X=RND 20 ? X;", "; 30 GOTO 10 EXAMPLE #3 10 CLS:? }20 X=INT(RND*10) 30 PAUSE 25:? X;", "; 40 GOTO 20 In this command the dummyvariable (0) has been eliminated.} Youcan still use the ATARi way RND(0) ifyou want to. In the example ln. 90you get random numbers from 0-9. Inln. 100 you} get random numbers from1-10. In ln. 200 you get randomnumbers from 0-99 FORMAT: RAND(n) EXAMPLE: 10 X = RAND(}10) 90 X = RAND(100) EXAMPLE #2 10 CLS 20 X = RAND(100) 30 ? X;", "; 40 PAU}SE 25 50 GOTO 20 In this command the randomnumbers are printed as integers. Theystart with 0 and end with the nu}mber-1 in the parentheses. FORMAT: SOUND EXAMPLE: 90 SOUND EXAMPLE #2 10 R=R+1 20 Y =} RAND(255) 30 SOUND 0,Y,10,8 40 PAUSE 100 50 SOUND 60 X = RAND(255) 70 SOUND 1,X,12,8 80 PAUSE }50 90 SOUND 100 IF R=8 THEN SOUND: R=0:GOTO 120 110 GOTO 10 120 END This command turns all} soundsoff. It is the same as 'SOUND0,0,0,0 FORMAT: TRAP #name EXAMPLE: 90 TRAP #END 95 TRAP #EN}D_OF_FILE This command is the same as '90TRAP 150' except it uses variablelabel names. For an application seeexample} #2 on the command '#name' ** STRINGS AND ERRORS ** ------------------------- FORMAT: TIME EXAMP}LE: 95 ? TIME/60 EXAMPLE #2 10 CLS:?:? 20 ? "TIMING A LOOP":?:? 30 S=TIME:REM STARTING TIME } 40 FOR X=1 TO 120:? X;", ";: NEXT X 50 E=(TIME-S)/60:REM E=ELAPSED, TIME-S = STARTING TIME 60 ?:}?:? INT(E*100)/100; " SECONDS" The TIME counter is active assoon as you turn on your computer. Itcounts 60 nu}mbers per second. To geta readout in seconds use TIME/60. Toget a readout in minutes useTIME/3600. To get a readout in hou}rsuse TIME/216000. The TIME counterwill continue as long as yourcomputer is turned on. If you want tostart the time count}er from thebeginning then press the RESETbutton. FORMAT: TIME$ EXAMPLE: 30 ? TIME$ EXAMPLE #2} 10 CLS:?:? 20 DIM T$(6) 30 INPUT "SET TIME - HHMMSS"; T$ 40 INPUT "WHEN TO STOP - HHMMSS"};S 50 CLS 60 TIME$=T$ 70 REPEAT 80 POKE 755,0:REM NO CURSOR 90 POSITION 10,10:? "HOURS, MIN,}SEC:";:? TIME$ 100 X=VAL(TIME$) 110 UNTIL X=S 120 POSITION 10,12:? "RING! RING! RING!" 130 POKE }755,3:REM CURSOR This command prints the time ofday in the form of HOUR MINUTE SECOND(HHMMSS). In Europe they use 50 }cyclecurrent and European ATARI'S run onthis current as against 60 cycle inthe USA. As a result of this theTIME$ function} is not accurate andgains 10 minutes each hour. FORMAT: INKEY$ EXAMPLE: 70 ? INKEY$ 90 A$=INKEY$} EXAMPLE #2 10 REM SCREEN WRITER 20 ? INKEY$; 30 GOTO 20 EXAMPLE #3 10 CLS:DI}M A$(1):?:?:REM GAME 20 ? "HIT THE KEY OF THE LETTER ON THE SCREEN!" 30 PAUSE 150 40 R=RAND(90):IF R<6}5 THEN 40 50 CLS:POSITION 19,12: ? CHR$(R) 60 PAUSE 55 70 A$=INKEY$ 80 IF A$=CHR$(R):GOTO 90: } ELSE:GOTO 100:ENDIF 90 ?:? "YOU GOT IT!":PAUSE 90: GOTO 40 100 ?:? "YOU MISSED IT!": PAUSE 90:}GOTO 40 This command returns thecharacter of the last key hat waspressed. In example #3 please noteline 70. Line 80 }uses and IF-ELSE-ENDIF command. FORMAT: INSTR(x$,a$,i) EXAMPLE: 50 ? INSTR(X$,A$,1) EXAMPLE #2} 10 DIM X$(30),A$(5) 20 X$="MY HEART BELONGS TO DADDY" 30 A$="DADDY" 40 ? "DADDY IS AT POSIT. "; } 50 ? INSTR(X$,A$,1) This command returns thebeginning of a sub string. The x$ =the original string. The a$ = the }substring you want to find. The i = theposition in numeric form that youwant to search the original string.This command w}ill return the positionnumber where the sub string starts.Spaces are also counted. FORMAT: UINSTR(x$,a$) } UINSTR(x$,a$,i) EXAMPLE: 50 ? UINSTR(X$,A$) 20 ? UNISTR(X$,A$,5) EXAMPLE #2 10 DI}M X$(40),A$(8) 20 X$="WHERE HAVE ALL THE SOLDIERS GONE" 30 A$="soldiers" 40 ? "soldiers IS AT POSIT";} 50 ? UINSTR(X$,A$) EXAMPLE #3 10 DIM X$(40),A$(8) 20 X$="ICH BIN EIN BERLINER" 30 A$="be}rliner" 40 ? "berliner IS AT POSIT."; 50 ? UINSTR(X$,A$,5) This command is the UniversalINSTR. It searches f}or thebeginning of a sub string.x$=original string. a$=sub string.i=starting position of the search.With UINSTR you can h}ave lower case,upper case or inverse as the substring. It does not distinguishbetween case. You can include oreliminate t}he starting position ofthe search. See example #2 and #3. FORMAT: ERR EXAMPLE: 20 ? ERR 90} ? "ERROR # ";ERR; " AT LINE ";ERL EXAMPLE #3 10 CLS:DIM A$(15):?:? 20 TRAP 90:REA}D A$ 30 ? A$ 40 GOTO 20 50 DATA MONDAY,TUESDAY, WEDNESDAY 60 DATA THURSDAY,FRIDAY 70 DATA SA}TURDAY,SUNDAY 90 REM ERROR TRAP ROUTINE 100 ?:? "ERROR # ";ERR; " AT LINE ";ERL 110 LIST DPEEK(186):R}EM LIST ERROR LINE This command list the last errornumber FORMAT: ERL EXAMPLE: 20 ? ERL  } 90 ? "ERROR # ";ERR; " AT LINE ";ERL This command prints the linenumber where the last error o }ccurred.See example #3 at 'ERR" ** LOOPS AND SUBROUTINES ** ----------------------------- In TURBO BASIC y }ou call asubroutine in 3 ways: 1) GOSUB - byline number. 2) PROCEDURE - by name.3) USR - by address. FORMAT: REPEAT } - UNTIL - EXIT EXAMPLE: 10 REPEAT:A=A+1 20 ? A 30 UNTIL A=6 EXAMPLE #2  } 10 CLS 20 A=64 30 ?:?:?:? 40 REPEAT:A=A+1 50 ? CHR$(A);", "; 60 UNTIL A=90 This command is a} loop. It willrepeat itself till the end conditionis met. The end condition must beincluded with the UNTIL statement.EXIT} gets you out of the loop. SeeDO-LOOP FORMAT: WHILE - WEND - EXIT EXAMPLE: 10 A=10:WHILE A 20 ? A} 30 A=A-1:WEND EXAMPLE #2 10 CLS:? 20 A=90:WHILE A:? CHR$(A); ", "; 30 I}F A=65 THEN A=1 40 A=A-1:WEND This command is a loop. As longas the WHILE remains NON-ZERO theloop will execute.} All statementsbetween WHILE and WEND will beexecuted. In example #2, A=A-1 isthe reverse counter. We terminate theloop b}efore it becomes zero with theIF-THEN. If you go out of this loopwith GOTO use the POP to clear thestack. Example #2 is th}e same as 'FORX=90 TO 64 STEP-1'. EXIT gets you outof the loop. See DO-LOOP FORMAT: DO - LOOP - EXIT EXAMPLE: }10 DO:A=A+1 20 ? A;", "; 30 IF A=15O THEN EXIT 40 LOOP The DO-LOOP is an infi}nte loopunless you use the EXIT command toget out of it. The DO and the LOOPare the 2 parts needed for this loop.Anything} between them will beprinted. FORMAT: IF - ELSE - ENDIF IF - ENDIF EXAMPLE: 90 IF X>3:}? "TOO LARGE:ELSE:? "OK": ENDIF 10 IF A<7 ? "YES" :ENDIF }EXAMPLE #2 10 CLS:?:? 20 INPUT "GIVE ME A NUMBER";A 30 IF A>5 40 PRINT A 50 GO# TOO_BIG }60 ELSE 70 PRINT A 80 GO# A_IS_OK 90 ENDIF 100 # TO_BIG:? "THIS NUMBER IS TOO LARGE":?:GO }TO 20 110 # A_IS_OK:? "THIS NUMBER IS JUST RIGHT" 120 END EXAMPLE #3 10 CLS:?:?:DIM A}$(1) 20 INPUT "IS THIS PORRIDGE OK(Y/N)";A$ 30 IF A$(1,1)="N":GO# TOO_HOT: ELSE:GO# JUST_RIGHT:ENDI}F 40 # TOO_HOT:?:? "THIS PORRIDGE IS TOO HOT SAID GOLDILOCKS" :END 50 # JUST_RIGHT:? :? "THIS IS } JUST RIGHT SAID GOLDILOCKS" This command as NO THEN in it.It can be used with an ELSE or not.If you use it on }one line be sure tohave a colon before and after theELSE (:ELSE:). This command must beterminated with an :ENDIF. The ENDI }Fhas a colon in front of it if it isused on one line. See example #3 line30. FORMAT: PROC - ENDPROC -(EXEC) E!}XAMPLE: 10 EXEC START_PROG 20 END 30 PROC START_PROG 40 ? "HELLO" 50 "}ENDPROC EXAMPLE #2 10 CLS:?:? 20 EXEC TOO_HARD 30 EXEC TOO_SOFT 40 EXEC JUST_RIGHT 5#}0 END 60 -- 70 PROC TOO_HARD 80 ? "GOLDILOCKS SAID THIS BED IS TOO HARD!":? 90 ENDPROC 100 -$}- 110 PROC TOO_SOFT 120 ? "GOLDILOCKS SAID THIS BED IS TOO SOFT!":? 130 ENDPROC 140 -- 150 %}PROC JUST_RIGHT 160 ? "GOLDILOCKS SAID THIS IS JUST RIGHT!" 170 ENDPROC This command is used like GO&}SUBexcept we use a variable label name.Just like GOSUB you should have anEND statement somewhere in yourprogram. The PROC'} stand for procedureand is called by the EXEC (execute)command. The EXEC looks for the PROCname and then executes it. The(}command is terminated with ENDPROC.Anything between PROC and ENDPROCwill be executed. ** GRAPHICS ** )} ---------------- To get a clear understanding ofthe various graphics modes, colors,screen positions and text window*}s etc.see the book "YOUR ATARI COMPUTER" byLon Poole et al. published byOsbrone/Mc Graw-Hill FORMAT: CIRCLE x,y,r+} EXAMPLE: 40 CIRCLE 160,96,20 EXAMPLE #2 10 GRAPHICS 8+16 20 COLOR 1 30 FOR X = 1 TO 90 ST,}EP 3 40 CIRCLE 160,96,X 50 NEXT X 60 GOTO 20 EXAMPLE #3 10 GRAPHICS 8+16 20 COLOR 1-} 30 FOR X=20 TO 300 STEP 20 40 CIRCLE X,96,80 50 NEXT X 60 GOTO 20 This command draws a circle. The.}graphic mode has to be stated in theprogram. x and y are the centerposition of the circle. r is theradius of the circle./} FORMAT: CIRCLE x,y,r,r2 EXAMPLE: 30 CIRCLE 160,96,50,70 EXAMPLE #2 10 GRAPHICS 8+16 20 0}COLOR 1 30 FOR X=1 TO 75 STEP 3 30 CIRCLE 160,96,X,X+25 40 NEXT X 50 GOTO 20 This command is the sa1}me asabove except we have a verticalradius r2 so we can draw true circlesor ellipses. x,y is the center of thecircle, r i2}s the radius and r2 is thevertical radius. FORMAT: FCOLOR n EXAMPLE: 30 FCOLOR 3 EXAMPLE #2 3} 10 GRAPHICS 7+16 20 COLOR 1 30 CIRCLE 80,48,45 40 FCOLOR 3 50 FILLTO 80,48 60 FCOLOR 1 70 FIL4}LTO 80,93 80 GOTO 20 FCOLOR is usually used inconjunction with the FILLTO command.FCOLOR selects the fill in col5}or. Thenumber of fill in colors depend onthe graphics mode. FORMAT: FILLTO x,y EXAMPLE: 70 FILLTO 80,93 T6}his command fills in a shapewith the color selected by the FCOLORcommand. It is the same as XIO18,#6,0,0,"S:". The x and y7} are thestarting position INSIDE the shape.See example #2 under FCOLOR. FORMAT: PAINT x,y EXAMPLE: 40 PAINT 808},48 EXAMPLE #2 10 GRAPHICS 7+16 20 COLOR 1 30 CIRCLE 80,48,45 40 PAINT 80,48 50 GOTO9} 20 This is also a type of fill incommand. This is a recursive routinethat will fill any closed shape. Thex and y ha:}ve to be the positioninside the shape to be filled. FORMAT: TEXT x,y,a$ EXAMPLE: 40 TEXT 3,8,A$ ;}EXAMPLE #2 10 CLS 20 DIM A$(4) 30 A$="WIND" 40 TEXT 3,8,A$ This command bit-blocks the textin A$ <}at position x,y ** CONSTANTS AND ERROR CODES ** --------------------------------- FORMAT: %0 %1 %2 %3 EX=}AMPLE: 20 X=%1 50 FOR T = %1 TO %3: ? T:NEXT T These 4 constants stand for thenumbers >}0 to 3. They are used likeregular numbers. "X=1" uses 10 byteswhile "X=%1" uses 4 bytes. When youuse these numbers you sav?}e on eachnumber 6 bytes. It is goodprogramming to make variables ofnumbers that are used more than 3times. N@}EW ERROR CODES --------------- TURBO-BASIC prints out inEnglish all errors. You do not haveto look up the A}error code numbersanymore. TURBO-BASIC has 8 new errorcodes not in ATARI-BASIC. The newerror codes are form 22 to 30 B} FORMAT: Error - 22 ?NEST The loops are not properly nested FORMAT: Error - 23 ?WHILE A WHILE-WEND lC}oop with no corresponding WHILE FORMAT: Error - 24 ?REPEAT An UNTIL with no corresponding REPEAT D} FORMAT: Error - 25 ?DO A DO-LOOP with no corresponding DO FORMAT: Error - 26 ?EXIT EXIT is outside E}a loop FORMAT: Error - 27 ?XPROC Error in executing a procedure ( There is no END line in your programF} etc.) FORMAT: Error - 28 ?EXEC ENDPROC with no corresponding EXEC. FORMAT: Error - 29 ?PROC PG}ROC does not exist FORMAT: Error - 30 ?# Variable name label dos not exist. FORMAT: Error - 15 H} Error 15 has been expanded toinclude an UNTIL which is in aREPEAT-UNTIL loop and which has beendeleted by mistake I}** ARITHMETIC AND LOGIC ** ---------------------------- FORMAT: HEX$(n) EXAMPLE: 20 ? HEX$(32) J} EXAMPLE #2 10 CLS:?:? 20 INPUT "GIVE ME A DECIMAL NUMBER";A 30 ? "DECIMAL ";A;" = HEX "; K}HEX$(A) 40 ?:GOTO 20 This command takes a decimalnumber and converts it into aHEXADECIMAL number FORMAT: L}DEC(a$) EXAMPLE: 20 A$="FF":? DEC(A$) EXAMPLE #2 10 CLS:?:?: DIM A$(8) 20 INPUT "GIVE ME THE M}HEX NUMBER";A$ 30 ? "HEX ";A$;" = DECIMAL "; DEC(A$) 40 ?:GOTO 20 This command changes aHEXAN}DECIMAL number to a decimalnumber. The HEX number must first beput into a string. FORMAT: n DIV i EXAMPLE: 20 O}A=9:B=4:? A DIV B EXAMPLE #2 10 CLS:?:? 20 INPUT "GIVE ME A NUMBER";A 30 INPUT "GIVE ME A SMALP}LER NUMBER";B 40 Q=A DIV B:R=A MOD B 50 ? A;"/";B;" = "; 60 ? Q;" REMAINDER ";R This command givQ}es you the wholenumber part of a division orfraction. Example 9/4=2 R 1. Thiscommand prints the 2. FORMAT: n MOD iR} EXAMPLE: 20 A=9:B=4:? A MOD B This command returns theremainder of a division as a wholenumber. Example 9/4=2 S}R 1 Thiscommand will print 1. See example #2above. FORMAT: FRAC(a) EXAMPLE: A=22/7:? FRAC(A) EXT}AMPLE #2 10 CLS:?:? 20 A=22/7 30 ? "THE FRACTION 22/7 = ";A 40 ? "THE DECIMAL PART OF 22/7 = ";FU}RAC(A) This command prints the decimalpart of a fraction ONLY. Example22/7=3.142857... This command prints142857...V} FORMAT: TRUNC(a) EXAMPLE: A=22/7:? TRUNC(A) EXAMPLE #2 10 CLS:?:? 20 A=22/7 30 ? "W}THE FRACTION 22/7 =";A 40 ? "THE INTEGER PART ="; TRUNC(A) This command prints the Integerpart of a fractX}ion ONLY. Example22/7=3.142857 it will print only 3 FORMAT: $nnnn EXAMPLE: 20 POKE $8000 EXAMPLEY} #2 10 CLS:?:? 20 FOR T = $0F TO $FF 30 ? T;", "; 40 NEXT T This command allows you to usehexadecZ}imal numbers but they areconverted to decimal numbers. Inexample #2 line 20 is converted to'FOR T = 15 TO 255. *[}* BOOLEAN LOGIC ** --------------------- The &, !, EXOR, are used inBOOLEAN logic. They are usually usedto \}compare 2 bits. The bits have tobe positive. Negative numbers willgive you an error. Each program willprint out a table fo]}r you of theresult of comparing 2 bits FORMAT: n & i EXAMPLE: 10 CLS:?:? 20 ?,"BOOLEAN 'AND' (&)" ^} 30 ? 40 ? "BIT ONE","BIT TWO", "RESULT" 50 ? "1 &","1 =",1&1 60 ? "0 &","1 =",0&1 70 ?_} "1 &";"0 =",1&0 80 ? "0 &";"0 =",0&0 This command is the BOOLEAN'AND' FORMAT: n ! i EXAMPLE:`} 10 CLS:?:? 20 ? ,"BOOLEAN 'OR' (!)" 30 ? 40 ? "BIT ONE","BIT TWO", "RESULT" 50 ? "1 !"a},"1 =",1!1 60 ? "0 !","1 =",0!1 70 ? "1 !","0 =",1!0 80 ? "0 !","0 =",0!0 This command is thb}e BOOLEAN'OR' FORMAT: n EXOR I EXAMPLE: 10 CLS:?:? 20 ? " BOOLEAN 'EXCULSIVE OR' (EXOR) c} 30 ? 40 ? "BIT ONE","BIT TWO", "RESULT" 50 ? "1 EXOR";"1 =",1 EXOR 1 60 ? "0 EXOR";"1 =",0 EXOR 1 d} 70 ? "1 EXOR","0 =",1 EXOR 0 80 ? "0 EXOR","0 =",0 EXOR 0 This command is the BOOLEAN"Exclusive Or' *e}* SELF BOOTING PROGRAMS ** ----------------------------- If you want to have a programthat runs itself upon boof}ting up thedisk name it 'AUTORUN.BAS'. TURBO-BASIC looks for a BASIC file by thisname when the boot process is inoperatiog}n ** NOTES ** ------------- Variables, Procedure Names andlabels may contain the underscorh}e(_). Now you can combine severalwords into a name that tells you WHATand WHERE it goes. This is apowerful feature to i}make yourprograms more legible. EXAMPLES: 10 TRAP 200 10 TRAP #END_OF_FILE 60 X = 65 60 j}# LAST_CHAR = 65 90 IF A$(1,1) = "Y" THEN 60 90 IF A$(1,1) = "Y" THEN # FETCH_LABEL DOUBLE QUk}OTES ------------- Double quotes are allowed inprint statements. Whenever you want aquote in a print statl}ement put indouble quotes. EXAMPLE: 30 ? "SHE SAID ""GOODBYE"" ANDSLAMMED THE DOOR" MULTIPLE LINEm} IF-ELSE-ENDIF ---------------------------- You can use several linesbetween IF and ELSE and ENDIF. Seeexample #2n} of IF-ELSE-ENDIF on page24 ARRAYS ------ You can have only NUMBER arrays.Just like ATo}ARI BASIC, TURBO-BASICdoes not allow string arrays. Numberarrays can be one or two dimensional. You must DIM each array.Op}ne dimensional array 'DIM A(5)'. Twodimensional arrays 'DIM A(5,8)'. ***************** * q} * * PUBLIC DOMAIN * * * ***************** I am collecting TURBO-BASICutilr}ities to be put into the PublicDomain. Your help is appreciated. Ifyou have a utility to share pleasesend it to the authors} (I prefer it ona disk if possible) This documentation is in thePublic Domain and may be copied byanyone! The t}author of this documentationapologizes for any omission ormistakes - they were accidental. If you cannot get this disu}kthrough any Public Domain sourceplease send $3.00 to the author tocover the expense of the disk, themailer and postage.v} If you have any comments orsuggestion about this documentation - they are welcome. Please write to: RONw} FETZER 22 MONACO AVE ELMONT, N.Y. 11003 USA TURBO-BASIC DOCUMENTATION INDEX ====x}=========================== NAME PAGE ---- ---- ARITHMETIC..........29 ARy}RAYS..............33 *B..................12 BGET................5 BLOAD...............2 BOOLEAN LOGIC....z}...31 BPUT................4 BRUN................2 CIRCLE..............26 CLOSE...............15 CLS.{}................6 CLS #n..............6 COMPUTERS...........1 DEC.................30 DEL(lines)..........|}8 DELETE(Disk Pgm)....2 DIM.................15 DIR.................2 DISK COMMANDS.......1 DIV......}}...........30 DO-LOOP.............24 DOS COMMANDS........1 DOUBLE QUOTES.......33 DPEEK...............4 ~} DPOKE...............3 DSOUND..............13 DUMP................8 DUMP name...........9 ERL.........}........23 ERR.................22 ERROR 15............29 ERROR 22............28 ERROR 23............28 } ERROR 24............29 ERROR 25............29 ERROR 26............29 ERROR 27............29 ERROR 28..}..........29 ERROR 29............29 ERROR 30............29 ERROR CODES.........28 EXOR................32} *F..................11 FCOLOR..............27 FETZER, RON.........34 FILLTO..............27 FRAC....}............30 GENERAL PROGRAM.....6 %GET................6 GET name............15 GO #name............14} GO TO...............11 GRAPHICS............26 HEX$................29 IF-ELSE-ENDIF.......24, 33 INKE}Y$..............21 INPUT...............10 INSTR...............21 *L..................11 LINE LABELS......}...13 LIST n..............16 LOADING.............1 LOCK................3 LOOPS & SUBROUTINES.23 MEMO}RY..............1, 3 MOD.................30 MODIFICATIONS.......15 MOVE................4 -MOVE...........}....4 #nnnn...............31 # name..............13 NOTES...............33 NUMBER SORT.........34 ON} a EXEC n1,n2.....16 ON a GO# n1,n2......16 OSTROWSKI, FRANK....1 PAINT...............27 PAUSE...........}....7 POP.................16 PROC-ENDPROC........25 PUBLIC DOMAIN.......34 %PUT................5 PUT} n...............17 RAND................18 RENAME..............3 RENUM...............7 REPEAT-UNTIL......}..23 RESTORE #name.......17 RND.................18 SELF-BOOTING........32 SORT................34 SOU}ND...............19 STRING SORTING......34 TEXT................28 TIME................19 TIME$...........}....20 TRACE...............9 TRAP #name..........19 TRUNC...............31 UINSTR..............22 UN}DERSCORE..........14, 33 UNLOCK..............3 USEABLE RAM.........1 VARIABLE LABELS.....14 VARIABLES NUM}BERS...1 WHILE-WEND..........23 !...................32 &...................32 %0 - %3.............28 } --..................13 ......23 !...................32 &...................32 %0 - %3.............28  3E:}DISK OPERATING SYSTEM II VERSION COPYRIGHT 1984 ATARI CORP.A. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDG}E J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRES}SF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE FILEH. WRITE DOS FILES P. FORMAT SINGLEL !N'}#"&))9(&*)/h)''-&؆莟R'S  vL/ˢ L }Insert DOS 2.0s, type Y Λx }DEfHI 1莏#q! @ y0ɛ8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT} ITEM OR FOR MENU! 0 .z:*{}.|{ 1 0 0JB 18L%|DL}%DIRECTORY--SEARCH SPEC,LIST FILE?[# 0 0 &|D3" 1L!NOT A DISK FILEN !B 1L!E# 1 !BD}ED:}:1BJ|DE 1DEBHI 1 h0ߢ 0.}  0?詛 1 y0YЛ 1 ;#L" ;#L! BL1TYPE "Y" TO DELETE...DELETE FILE SPEC}COPY--FROM, TO?OPTION NOT ALLOWED697 FREE SECTORS COPYING---D8:COPY32.COMl# 0|D .L/%#}##JB|DE 1BHID#E 1#0: B 1L!#͑### B 1#c$0SY}S1}:## # # .#Ƚ# # 𩛙## 1,#PD#ELJ- <.BJD#E }1 1HH 0hh|DL%1}:̳# L% #D#EL% 1 0 . .0O% 1L!WILD CARDS NOT A}LLOWED IN DESTINATION 0 <.|K L :::: :Lr:::IEL[::i:iIIL[:`:i::i}::L:`L{:w:w: C`L:L: D8:MEM.SAV: 8| 9 '9`L:L: D:DUP.SYS:̩ 8} x:ɀL: '9`88 |9Y:X: '9L); D8:DUP.SYS; 8::88 9 '98? :`;WL`; 9}Ln; ` :Y;Y;L;L;)} Setting Up ATARI 130XE Ram Disk; 9L; ; -9  } L;D8:; :9 :Y;L