@L `}/j5  $% l0?$)$$Hȱ$ ShL$ `e$$%` h?/ `  !I PR@1 YL I`! S S) H$ЙH 0}Џ$%`@ $% CC$$%e%dU$% ]0%$% DDmLp   % J)Lz J  (( o L (y/)  [L< ( yL Z 0o Tya y }4IB [y32C/10m?4 V V  wLL a ` V y/})23LzA! ߰")-݈ y" $zzG@LL 08` k")};1k0 -G$Ș݈ SL! 9 y8(()(0˥)Nk`$GȘ݈LS )L ݈ L GzȘ} ݈LL )W>Z   HH)H o h  yhy00hy11/ V  }L> L JJaHJJJh) yLT J u (`  IBLH % 6h HHGH`LdJ })LJJLw!,"!,/@F  L! ! 0E^  }^ E E7EȩEdE/EȩE / ! Vΐ )L   mx n wym }?x7x?4 ( ) w y32 R V LL n w ) V  L y / o   }E` , ny/) / V Ly/) 0BM݌L݋ ML  N݈ L }NLML [ fEqEHȱEqEh 3Gȹ G KLL GzɛL  L}FREE SECTORSy /H) *Gȩ GȽ4G GȌyh%*J >G<-+=!*?%% &%z3%$$HEL{*DIR*LOC.CLR.LOA-VER%INI+UNL.FMS.SAV,MODg%CARR*REN?,FME.H"}EAP)BAC_%BONo1DEL.FMD.SUM(RUNm*BOF|1COP3&FMQ.TYP.)EXE$ 1Y5P" O."8""@R'S15%#}0i5i5501ȊԢx5"JFJPWy"HH *5")IAY54 4> 4,0$}L#N #L|*J #L*J #14"4`J # 1Lk*v} 4 *%H$H`)?4 $ 4 #$0 %} 2 4 $ y$, L$LL-19" !"H "H` $ $Ѻ Ѻ걺 2ȱ 4ɛL"ȱH&}H 2e滠滱 u2`> 8e滐`+"`e` y$ 2" 2Execute: W. /p O. '}/ 1L"*ԆՎ l$ 2 \*L#L)4 % HJJJJ 3. 4h 3 3XFHSEX; 4L4(}"݅pq y$ 2ݹp` %ݱp 3`,5 2`N5 l$ /0 / 1 l$L$$8n" }$ 2pq y$I eppq> )}4pq 3 3p,"0 ' 4 3L& 3`p8pqŠ 2ݑpȥpȄ(` /5D . 5 - #( l*}$ / #(莉5 2Reading: . .ii e֥iש 0( . `1,P3 1S / / 1&+}& 5$?♵5 -8tu E( rȥs(0 O. .Еߥ .8 ' 0( 2Writing: rȱsr* / /,} ,` / 1rs8 E($0 O. . .C .L'5  e . 'Lx&,5PJC`,50 2I-}nsert ( 2sourceL' 2destination 2 & hit key ! #ڭ ҍ5L25`5օtׅu` S2tu /.} 1HrettIseuu(` (x / / O.L1`$0'5 / S2 1XY O./}8` W.r n( (errstuvw 2LEN: vw 3u 3 2 SUM: st 3rL3 W.$0 * n( ( 4LB)0}N` W.ʆ n( ($0,F (!$0բ 2No COM-File !LO. (8ԨՐυلإ5 * 1}2# 2RUN: E* 3 2INIT: E*L^) * 3 2. ԥ 3- 4֥ 3 2 LEN:إ 3 (L)إL^) 2}( ( 3L3 1 y$T 4T l y$l 2l *" 4 3 * $ $ 4 2 *ݥURL4` 3}, /$0"I" 1 n+,"0e+Di5Ei Q2 1 2 V/8," 24}LV+ԩ 3: 4 4I 4L+ 2D5:1 4 2: $;0+ 2SINGLE 2 DENSITY 2 RAMDISKL* 2ENH5}ANCEDp 2DOUBLE 2QUAD }/5,5$ 1 O.$0 `DOS.SYS8f5ȩU5ȩP5婿t"Y56}L, / - l$ / /X,L. /,55 5.5 橛5L/LL$ }/ l$ 2 2刄t( 287}$, 2RUN : y-ft 2INIT: y-ft 1 -$tP`$tPF$6ee8}ȄԄՠ$0֩ /$0 q- /8ਥi S2 L15 4ɛ 2` y$ 2 " 2Load: W.9} /$莞 1 -5 lL"0L2`")i"` 1 . / Q2 1'  Q2 1٠:}0 V/ .L.L2 BLVhihi / -i(i( -8((((.. . `1 1 - .;}`5  e`,,,,"H 0hZ,!,#,$/ /$0 $0ZL/ -/L. / /"L11/2/5<} 5 H.5h5ک5`5c/d/ 5? $08`$0`45 [2519 5=}55 /$05455 /5ED` *50 4`5008f [2R0/@ 2.>}/ȱ 280@0  eiȱ/\FȢɛ  o- *  D.8;+"/+ȱ0"?}LL$V ȱ+F/ڊ u2 80 ? 00 0/+$0Wy`5 ` 2Sure ? 1Q`$O 2es, @}o or bort? 81YN 4(` 'ɛ)YN A 2AL"` * 4 `)  ӆiA}j O.+ /  /$0Ș,J, 1B V0`1 O.:>ݩ,".U * 2 is locked !Unlock file? 1ݐ`B}$ 1УԢ5 )p O. * * 2# 4 3L"IH`:;:` ,ɛ`` u2` *C}hihi 4eiHH` ," 4 2 8`0:` 3` 2iԥiդ o$ԥ(`LL$ 2ԍ2Ս2D}Ԇՠ+22ȱ.6'`0#: AG6  &&`8`芄  (` }$ 2 2 3 E}2=' 38nɛL4ԥ 3 2=.݆ކ&բuݕت 3ߊ, 3HJJJJ 3h) 0:i,  F}4,500 BHI V,L2,"p:ɛUR.* t4 t4^ 81 t4( $x0Nhh`S8R^`倈G}HH`p@BDE-HI V0H-` O. 4L2L"ȱ 4ɛ`D1:*.*pB 5H}0#452"/ $/38%by("arth&"ruchhaeuserc -2eitershan#omputertechnikI"L2L"ȱ 4ɛ`D1:*.*pB 5[8<<  B JKIHiDiELV`L8 8 BLV`LxJ}8t8l Lu8hihiHHȱȱL8c !#3`Lu8JJJJ`H 8h`HK}ȩh Q8L8 Z8L8 8L8 8L8 8L8S:@9E:E9H '9 H9I9 8 '9h)0ICL}9D9L8 L :::: :Lr:::IEL[::i:iIIL[:`:i::iN}::L:`L{:w:w: C`L:L: D8:MEM.SAV: 8| 9 '9`L:L: D:DUP.SYS:̩ 8O} x:ɀL: '9`88 |9Y:X: '9L); D8:DUP.SYS; 8::88 9 '98? :`;WL`; 9P}Ln; ` :Y;Y;L;L;)} Setting Up ATARI 130XE Ram Disk; 9L; ; -9  Q} L;D8:; :9 :Y;L:A%,"-@@E(WHAT SCREEN COLOR DO YOU WANT?V}Q6-n#-@@#( 1: NORMALx"-@@"(2: AMBER*-@@*(3: REVERSE AMBERW}"-@@"(4: GREEN!-@@!(5: GREYB A`-@@4(SELECT A NUMBER8B BX}Q  @)!@)P:,G("ERROR: SELECT A NUMBER FORM 1 TO 5Q A`//AAAA Y}A01AAH'A @1 A@1A@T'A @1 A@1A@VZ}'A 1 A@1AA''A @1 A@1A@'A @1 A@[}}<;@0,;A0,;@,;@,;@,I(>:A%,[-@@ }(Documentation for TU\}RBO BASIC1-@@1(PRESS ٠ TO SCROLL6-@@,(CREEN OR RINTER03(6(;;7@]}<@,4S)7@<@,4sA";;7@<@,4P)7@<@,4pA,MAR@^} @M@@D1:TURBODOC.NEW6( AP@(6-%@@(J"@  A_}pT A^5F:A,"A6#@5ARh,,($------------------------------------r( `} ** END **w-@A | +;@;@@D1:TURBODOC.NEW\a}(>:A%,"-@@X(0DID YOU SET PAPER TO THE TOP OF ITS FORM (Y/N)\$$7@<@,0YAb}3 3 330(>:A%,"-@@0( PRINTING!( A@(6-%@.@.@c}@P:&&(@ "@W A  A@@F:A,"A6#d}@.@@AR<6-6-@W&5-@+%@,83< ,,($--------------------e}----------------::3$ -%@-( ** END ** +&??f}PROGRAM BY RON. FETZER, 22 MONACO AVE, ELMONT, N.Y. 110030:SCROLLING ROUTINED##@@K:Ng})@X"@: ,Ab6-@$lPAGE ROUTINEv6-6-%@Q(@h}(@Q(@$ --&-@@"(@& $D:MENU} EXPANDED TURBO BASIC DOCUMENTATION ================================== by Ron. Fetzer This expanded documj}entation isbased on the pioneering work of Daveand Laura Yearke of the Western NewYork Atari Users Group. The superb k}Turbo Basic by FrankOstrowski from Holland works only onthe Atari XL and Atari XE computers.It is completely compatible wil}thATARI BASIC. In addition to theregular Atari Basic commands you get42 more commands and 22 morefunctions. You have a usm}eable RAM of34,021 bytes. This is 1,747 morebytes than Atari Basic. It runs 3times faster than Atari Basic and youhave a n}BASIC COMPILER that increasesthe speed 10 to 15 times more. The DOS commands are accessed inthe direct mode or the proo}grammedmode. There is no Turbo Basic DOS.You have new graphics commands notavailable before. Turbo Basic isinsensitive top} upper or lower orinverse characters for most of itscommands. You can have 256 variablenames. This documentation trieq}s toprovide programming examples for thenew commands. There is an index atthe end of this documentation foreasy finding or}f commands ** LOADING TURBO BASIC ** -------------------------- Turbo Basic gets loaded withouta cartrids}ge. 1. Turn on your diskdrive. 2. Insert the Turbo Basicdisk. 3. On the XE hold down theOPTION key and turn on the computet}r. ** DISK COMMANDS ** ------------------- The DOS functions are accessedin the direct or the progru}ammed mode.There is no Turbo-DOS. If you typeDOS you are directed to DOS 2.5. Youare now out of Turbo Basic. It issuggestv}ed that you save your programfirst otherwise it is lost. You canget back into Turbo Basic by usingOPTION L on the DOS and w}typingAUTORUN.SYS for the file name. FORMAT: BLOAD "D:name" EXAMPLE: BLOAD "D:TEST.BIN" This command is ux}sed to loadbinary files. The file willautomatically load without having togive a memory address. It is justlike Option L y}with /N on DOS 2.0 FORMAT: BRUN "D:name" EXAMPLE: BRUN "D:COMPILER.COM" This is used to load and RUN amacz}hine 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.B|}AS" DELETE "D8:test.bas" delete "D2:*.*" Delete "D2:TEST.???" 90 DELE}}TE "D:*.*" This command erases from thedisk a file specified. The wild cardsymbols (*.* and ???) are permitted.The d~}evice name (D:) has to be incapital letters. Inverse file namesare not permitted. In the programmedmode it has to be the l}ast item onthe line. This is the same as OptionD on DOS 2.0 FORMAT: DIR (Wild cards O.K.) EXAMPLE: DIR } DIR "D:*.*" DIR "D2:*.BAS" DIR "D:???.*" DIR "D8:*.*" 90 DIR "}D8:*.*" This command gives you the diskdirectory. Wild cards are permitted.In the programmed mode it has to bethe la}st item on the line. This isthe same as Option A on DOS 2.0 FORMAT: RENAME "D:old name,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. Wildca}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: } DPOKE m,v EXAMPLE: DPOKE 88,32750 90 DPOKE 88,32750 This command puts 2 bytes ofdata into 2 conse}cutive memorylocations. In the example above atPOKE 88 and POKE 89 integer 32750 isstored. FORMAT: DPEEK(m) E}XAMPLE: ? DPEEK(88) 90 ? DPEEK(88) This is the opposite of DPOKE.It retrieves a 2 byte integer from 2co}nsecutive locations. In the exampleabove at PEEK(88) and PEEK(89) FORMAT: MOVE m,m1,m2 EXAMPLE: MOVE 53248,3276}8,1024 MOVE $D000,$8000,$400 This moves a whole block ofdata. The 'm' is the old address, the'm1' is th}e new address and the 'm2'is the lenght of the data in bytes FORMAT: -MOVE m,m1,m2 EXAMPLE: -MOVE 53248,32768,1}024 -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 PRINT " FILL THE SCREEN" 130 FOR X = 1 TO (20*40) 140 POKE ADDR+X,RAND(}125) 150 NEXT X 160 ? "Now BPUT data onto RAMDISK D8:SCREEN" 170 CLOSE:OPEN #1,8,0,"D8: SCRE}EN" 180 BPUT #1,ADDR,20*40 190 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 the RAMDISK the screen data under the filename "SCREEN". It can be recoveredwith BG}ET. See the next command. FORMAT: BGET #n,adr,len EXAMPLE: BGET #3,ADR(B$), LEN(B$) } EXAMPLE #2 100 CLS 110 GRAPHICS 5:ADDR=DPEEK(88) 120 CLOSE:OPEN #1,4,0, "D8:SCREEN" 130 ? "BGE}T data from RAM DISK D8:'SCREEN'" 140 BGET #1,ADDR,20*40 150 CLOSE 160 FOR Y=1 TO 6000:NEXT Y 17}0 GRAPHICS 0 BGET recovers a block of datasaved with BPUT. The '#n' is thechannel number(1-7), 'adr' is thememory ad}dress and 'len' is thelength of the data. FORMAT: %PUT #n,a EXAMPLE: %PUT #1,A EXAMPLE #2 1}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 6}0 NEXT X:CLOSE 70 ?:? "I have saved 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 channelfo}r %PUT. See the demonstartionprogram on the front of this disk.Use RUN "D:PUTGET.TUR". If you have aXL computer list the p}rogram andchange all referrences from D8: toD1: and then run it. You can retrievethe numbers in EXAMPLE #2 by usingthe %G}ET program that follows. It isused with NUMBERS only. FORMAT: %GET #n,a EXAMPLE: %GET #1,A EXAMP}LE #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:CL}OSE 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. ** } 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 c}ommand clears the screen.It is the same as pressingCNTRL+CLEAR or ? CHR$(125) FORMAT: CLS #n(channels 1-7) EX}AMPLE: 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 5}0 ? "PRESS ANY KEY"; 60 GET #3,L 70 ?:? "YOU PRESSED THE "; CHR$(L);" KEY":? 80 CLS #3 90 GOTO 40} This command clears the screenof 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 REPEAT:A=A+1 40 ? A;", "; 50 PAUSE 10*X 60 UNTIL A=20 This command pu}ts a time delayof about 1/60 of a second into yourprogram for each number. PAUSE 60 =about 60/60 or 1 second delay. It is}the similar to 'FOR X = 1 TO 60:NEXTX'. Computed values are allowed.Negative values are not allowed. FORMAT: RENUM n},i,j EXAMPLE: RENUM 10,100,10 90 RENUM 100,10,10 EXAMPLE #2 10 CLS 20 ? "RENUMBE}R PLEASE!" 30 PAUSE 100 40 LIST 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 L}IST This command renumbers yourprogram. The 'n' is the program linenumber that you want to startrenumbering with. Th}e 'i' is thefirst NEW number. The 'j' is theincrement. It will not renumber linereferences which involve variables orcomp}uted values. See example #3. FORMAT: DEL n,i EXAMPLE: DEL 60,100 90 DEL 50,80 EXAMP}LE #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. Itc}an be used in the direct orprogrammed mode. FORMAT: DUMP EXAMPLE: DUMP 90 DUMP EXA}MPLE #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 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 - truns 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 laudest. 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 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 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 * ---------------------------------- 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' 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 PUA!}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 numb+}ers per second. To geta readout in seconds use TIME/60. Toget a readout in minutes useTIME/3600. To get a readout in hours,}use TIME/216000. The TIME counterwill continue as long as yourcomputer is turned on. If you want tostart the time counter-} 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,SE0}C:";:? TIME$ 100 X=VAL(TIME$) 110 UNTIL X=S 120 POSITION 10,12:? "RING! RING! RING!" 130 POKE 751}5,3:REM CURSOR This command prints the time ofday in the form of HOUR MINUTE SECOND(HHMMSS). In Europe they use 50 cy2}clecurrent and European ATARI'S run onthis current as against 60 cycle inthe USA. As a result of this theTIME$ function i3}s not accurate andgains 10 minutes each hour. FORMAT: INKEY$ EXAMPLE: 70 ? INKEY$ 90 A$=INKEY$ 4} EXAMPLE #2 10 REM SCREEN WRITER 20 ? INKEY$; 30 GOTO 20 EXAMPLE #3 10 CLS:DIM 5}A$(1):?:?:REM GAME 20 ? "HIT THE KEY OF THE LETTER ON THE SCREEN!" 30 PAUSE 150 40 R=RAND(90):IF R<65 6}THEN 40 50 CLS:POSITION 19,12: ? CHR$(R) 60 PAUSE 55 70 A$=INKEY$ 80 IF A$=CHR$(R):GOTO 90: 7} ELSE:GOTO 100:ENDIF 90 ?:? "YOU GOT IT!":PAUSE 90: GOTO 40 100 ?:? "YOU MISSED IT!": PAUSE 90:GO8}TO 40 This command returns thecharacter of the last key hat waspressed. In example #3 please noteline 70. Line 80 us9}es 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 su<}bstring you want to find. The i = theposition in muneric form that youwant to search the original string.This command wil=}l 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 DIM ?}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$="berlA}iner" 40 ? "berliner IS AT POSIT."; 50 ? UINSTR(X$,A$,5) This command is the same asINSTR above. It searchesB} for thebeginning of a sub string.x$=original string. a$=sub string.i=starting position of the search.With UINSTR you canC} have lower case,upper case or inverse as the substring. It does not distinguishbetween case. You can include oreliminateD} the starting position ofthe search. See example #2 and #3. FORMAT: ERR EXAMPLE: 20 ? ERR E}90 ? "ERROR # ";ERR; " AT LINE ";ERL EXAMMPLE #3 10 CLS:DIM A$(15):?:? 20 TRAP 90:F}READ A$ 30 ? A$ 40 GOTO 20 50 DATA MONDAY,TUESDAY, WEDNESDAY 60 DATA THURSDAY,FRIDAY 70 DATAG} SATRUDAY,SUNDAY 90 REM ERROR TRAP ROUTINE 100 ?:? "ERROR # ";ERR; " AT LINE ";ERL 110 LIST DPEEK(186H}):REM LIST ERROR LINE This command list the last errornumber FORMAT: ERL EXAMPLE: 20 ? ERL I} 90 ? "ERROR # ";ERR; " AT LINE ";ERL This command prints the linenumber where the last erroJ}r occurred.See example #3 at 'ERR" ** LOOPS AND SUBROUTINES ** ----------------------------- In TURBO BASIK}C you call asubroutine in 3 ways: 1) GOSUB - byline number. 2) PROCEDURE - by name.3) USR - by address. FORMAT: REPL}EAT - UNTIL - EXIT EXAMPLE: 10 REPEAT:A=A+1 20 ? A 30 UNTIL A=6 EXAMPLE #2M} 10 CLS 20 A=64 30 ?:?:?:? 40 REPEAT:A=A+1 50 ? CHR$(A);", "; 60 UNTIL A=90 This command iN}s a loop. It willrepeat itself till the end conditionis met. The end condition must beincluded with the UNTIL statement.EO}XIT gets you out of the loop. SeeDO-LOOP FORMAT: WHILE - WEND - EXIT EXAMPLE: 10 A=10:WHILE A 20 P}? A 30 A=A-1:WEND EXAMPLE #2 10 CLS:? 20 A=90:WHILE A:? CHR$(A); ", "; 3Q}0 IF A=65 THEN A=1 40 A=A-1:WEND This command is a loop. As longas the WHILE remains NON-ZERO theloop will execuR}te. All statementsbetween WHILE and WEND will beexcecuted. In example #2, A=A-1 isthe reverse counter. We terminate theloS}op before it becomes zero with theIF-THEN. If you go out of this loopwith GOTO use the POP to clear thestack. Example #2 iT}s the same as 'FORX=90 TO 64 STEP-1'. EXIT gets you outof the loop. See DO-LOOP FORMAT: DO - LOOP - EXIT EXAMPU}LE: 10 DO:A=A+1 20 ? A;", "; 30 IF A=15O THEN EXIT 40 LOOP The DO-LOOP is an V}infinte loopunless you use the EXIT command toget out of it. The DO and the LOOPare the 2 parts needed for this loop.AnytW}hing between them will beprinted. FORMAT: IF - ELSE - ENDIF IF - ENDIF EXAMPLE: 90 IF X}X>3:? "TOO LARGE:ELSE:? "OK": ENDIF 10 IF A<7 ? "YES" :ENDIF Y} EXAMPLE #2 10 CLS:?:? 20 INPUT "GIVE ME A NUMBER";A 30 IF A>5 40 PRINT A 50 GO# TOO_BIG Z} 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:?:?:D\}IM A$(1) 20 INPUT "IS THIS PORRIDGE OK(Y/N)";A$ 30 IF A$(1,1)="N":GO# TOO_HOT: ELSE:GO# JUST_RIGHT:]}ENDIF 40 # TOO_HOT:?:? "THIS PORRIDGE IS TOO HOT SAID GOLDILOCKS" :END 50 # JUST_RIGHT:? :? "THIS I^}S 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 `}ENDIFhas a colon in front of it if it isused on one line. See example #3 line30. FORMAT: PROC - ENDPROC -(EXEC) a} EXAMPLE: 10 EXEC START_PROG 20 END 30 PROC START_PROG 40 ? "HELLO" b} 50 ENDPROC EXAMPLE #2 10 CLS:?:? 20 EXEC TOO_HARD 30 EXEC TOO_SOFT 40 EXEC JUST_RIGHT c} 50 END 60 -- 70 PROC TOO_HARD 80 ? "GOLDILOCKS SAID THIS BED IS TOO HARD!":? 90 ENDPROC 1d}00 -- 110 PROC TOO_SOFT 120 ? "GOLDILOCKS SAID THIS BED IS TOO SOFT!":? 130 ENDPROC 140 -- e}150 PROC JUST_RIGHT 160 ? "GOLDILOCKS SAID THIS IS JUST RIGHT!" 170 ENDPROC This command is used likf}e GOSUBexcept we use a variable label name.Just like GOSUB you should have anEND statement somwhere in yourprogram. The Pg}ROC stand for procedureand is called by the EXEC (execute)command. The EXEC looks for the PROCname and then executes it. Tq}BDOS SYSB(!DUP SYSB IRAMDISK COMBRAUTORUN SYSBTMENU BjiTURBODOCNEWhecommand is terminated with ENDPROC.Anything between PROC and ENDPROCwill be executed. ** GRAPHICS ** r} ---------------- To get a clear understanding ofthe various graphics modes, colors,screen postions and text winds}ows etc.see the book "YOUR ATARI COMPUTER" byLon Poole et al. published byOsbrone/Mc Graw-Hill FORMAT: CIRCLE x,y,rt} EXAMPLE: 40 CIRCLE 160,96,20 EXAMPLE #2 10 GRAPHICS 8+16 20 COLOR 1 30 FOR X = 1 TO 90 u}STEP 3 40 CIRCLE 160,96,X 50 NEXT X 60 GOTO 20 EXAMPLE #3 10 GRAPHICS 8+16 20 COLOR v}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. Thw}egraphic mode has to be stated in theprogram. x and y are the centerposition of the circle. r is theradius of the circle.x} FORMAT: CIRCLE x,y,r,r2 EXAMPLE: 30 CIRCLE 160,96,50,70 EXAMPLE #2 10 GRAPHICS 8+16 2y}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 z}same asabove except we have a verticalradius r2 so we can draw true circlesor ellipses. x,y is the center of thecircle, r{} is the radius and r2 is thevertical radius. FORMAT: FCOLOR n EXAMPLE: 30 FCOLOR 3 EXAMPLE #2 |} 10 GRAPHICS 7+16 20 COLOR 1 30 CIRCLE 80,48,45 40 FCOLOR 3 50 FILLTO 80,48 60 FCOLOR 1 70 F}}ILLTO 80,93 80 GOTO 20 FCOLOR is usually used inconjunction with the FILLTO command.FCOLOR selects the fill in c~}olor. Thenumber of fill in colors depend onthe graphics mode. FORMAT: FILLTO x,y EXAMPLE: 70 FILLTO 80,93 } This command fills in a shapewith the color selected by the FCOLORcommand. It is the same as XIO18,#6,0,0,"S:". The x and} y are thestarting position INSIDE the shape.See example #2 under FCOLOR. FORMAT: PAINT x,y EXAMPLE: 40 PAINT }80,48 EXAMPLE #2 10 GRAPHICS 7+16 20 COLOR 1 30 CIRCLE 80,48,45 40 PAINT 80,48 50 GO}TO 20 This is also a type of fill incommand. This is a recursive routinethat will fill any closed shape. Thex and y }have 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 }EXAMPLE: 20 X=%1 50 FOR T = %1 TO %3: ? T:NEXT T These 4 constants stand for thenumber}s 0 to 3. They are used likeregular numbers. "X=1" uses 10 byteswhile "X=%1" uses 4 bytes. When youuse these numbers you s}ave on eachnumber 6 bytes. It is goodprogramming to make variables ofnumbers that are used more than 3times. } NEW ERROR CODES --------------- TURBO-BASIC prints out inEnglish all errors. You do not haveto look up th}e error code numbersanymore. TURBO-BASIC has 8 new errorcodes not in ATARI-BASIC. The newerror codes are form 22 to 30 } FORMAT: Error - 22 ?NEST The loops are not properly nested FORMAT: Error - 23 ?WHILE A WHILE-WEND} loop with no corresponding WHILE FORMAT: Error - 24 ?REPEAT An UNTIL with no corresponding REPEAT } FORMAT: Error - 25 ?DO A DO-LOOP with no corresponding DO FORMAT: Error - 26 ?EXIT EXIT is outsid}e a loop FORMAT: Error - 27 ?XPROC Error in executing a procedure ( There is no END line in your progr}am etc.) FORMAT: Error - 28 ?EXEC ENDPROC with no corresponding EXEC. FORMAT: Error - 29 ?PROC } PROC does not exist FORMAT: Error - 30 ?# Variable name label dos not exist. FORMAT: Error - 15 } Error 15 has been expanded toinclude an UNTIL which is in aREPEAT-UNTIL loop and which has beendeleted by mistake } ** ARITHMETIC AND LOGIC ** ---------------------------- FORMAT: HEX$(n) EXAMPLE: 20 ? HEX$(32) } EXAMPLE #2 10 CLS:?:? 20 INPUT "GIVE ME A DECIMAL NUMBER";A 30 ? "DECIMAL ";A;" = HEX "; } HEX$(A) 40 ?:GOTO 20 This command takes a decimalnumber and converts it into aHEXIDECIMAL number FORMAT:} DEC(a$) EXAMPLE: 20 A$="FF":? DEC(A$) EXAMPLE #2 10 CLS:?:?: DIM A$(8) 20 INPUT "GIVE ME TH}E HEX NUMBER";A$ 30 ? "HEX ";A$;" = DECIMAL "; DEC(A$) 40 ?:GOTO 20 This command changes aHE}XIDECIMAL number to a decimalnumber. The HEX number must first beput into a string. FORMAT: n DIV i EXAMPLE: 2}0 A=9:B=4:? A DIV B EXAMPLE #2 10 CLS:?:? 20 INPUT "GIVE ME A NUMBER";A 30 INPUT "GIVE ME A SM}ALLER NUMBER";B 40 Q=A DIV B:R=A MOD B 50 ? A;"/";B;" = "; 60 ? Q;" REMAINDER ";R This command g}ives you the wholenumber part of a division orfraction. Example 9/4=2 R 1. Thiscommand prints the 2. FORMAT: n MOD }i EXAMPLE: 20 A=9:B=4:? A MOD B This command returns theremainder of a division as a wholenumber. Example 9/4=}2 R 1 Thiscommand will print 1. See example #2above. FORMAT: FRAC(a) EXAMPLE: A=22/7:? FRAC(A) }EXAMPLE #2 10 CLS:?:? 20 A=22/7 30 ? "THE FRACTION 22/7 = ";A 40 ? "THE DECIMAL PART OF 22/7 = "};FRAC(A) This command prints the decimalpart of a fraction ONLY. Example22/7=3.142857... This command prints142857..}. FORMAT: TRUNC(a) EXAMPLE: A=22/7:? TRUNC(A) EXAMPLE #2 10 CLS:?:? 20 A=22/7 30 ?} "THE FRACTION 22/7 =";A 40 ? "THE INTEGER PART ="; TRUNC(A) This command prints the Integerpart of a fra}ction ONLY. Example22/7=3.142857 it will print only 3 FORMAT: $nnnn EXAMPLE: 20 POKE $8000 EXAMP}LE #2 10 CLS:?:? 20 FOR T = $0F TO $FF 30 ? T;", "; 40 NEXT T This command allows you to usehexid}ecimal 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 usedt}o compare 2 bits. The bits have tobe positive. Negative numbers willgive you an error. Each program willprint out a table }for 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 EXAMPL}E: 10 CLS:?:? 20 ? ,"BOOLEAN 'OR' (!)" 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'OR' FORMAT: n EXOR I EXAMPLE: 10 CLS:?:? 20 ? " BOOLEAN 'EXCULSIVE OR' (EXOR) } 30 ? 40 ? "BIT ONE","BIT TWO", "RESULT" 50 ? "1 EXOR";"1 =",1 EXOR 1 60 ? "0 EXOR";"1 =",0 EXOR 1} 70 ? "1 EXOR","0 =",1 EXOR 0 80 ? "0 EXOR","0 =",0 EXOR 0 This command is the BOOLEAN"Exclusive Or' } ** SELF BOOTING PROGRAMS ** ----------------------------- If you want to have a programthat runs itself upon b}ooting up thedisk name it 'AUTORUN.BAS'. TURBO-BASIC looks for a BASIC file by thisname when the boot process is inoperat}ion ** NOTES ** ------------- Variables, Procedure Names andlabels may contain the undersc}ore(_). Now you can combine severalwords into a name that tells you WHATand WHERE it goes. This is apowerful feature t}o make yourprograms more legible. EXAMPLES: 10 TRAP 200 10 TRAP #END_OF_FILE 60 X = 65 6}0 # LAST_CHAR = 65 90 IF A$(1,1) = "Y" THEN 60 90 IF A$(1,1) = "Y" THEN # FETCH_LABEL DOUBLE }QUOTES ------------- Double quotes are allowed inprint statements. Whenever you want aquote in a print st}atement put indouble quotes. EXAMPLE: 30 ? "SHE SAID ""GOODBYE"" ANDSLAMMED THE DOOR" MULITIPLE L}INE IF-ELSE-ENDIF ---------------------------- You can use several linesbetween IF and ELSE and ENDIF. Seeexample} #2 of IF-ELSE-ENDIF on page24 ARRAYS ------ You can have only NUMBER arrays.Just like} ATARI BASIC, TURBO-BASICdoes not allow string arrays. Numberarrays can be one or two dimensional. You must DIM each array}.One dimensional array 'DIM A(5)'. Twodimesnional arrays 'DIM A(5,8)'. Fora tutorial on arrays and sorting seethe back of} this disk. SORTING For a tutorial on sorting ofnumbers and strings see the back ofthis disk. } ***************** * * * PUBLIC DOMAIN * * * *********}******** I am collecting TURBO-BASICutilities to be put into the PublicDomain. Your help is appreciated. Ifyou have }a utility to share pleasesend it to the author (I prefer it ona disk if possible) This documentation is in thePublic} Domain and may be copied byanyone! The author of this documentaionapologizes for any omission ormistakes - they wer}e accidental. If you cannot get this diskthrough any Public Domain sourceplease send $5.00 to the author tocover the} expense of the disk, themailer and postage. If you have any comments orsuggestion about this documentation - they a}re welcome. Please write to: RON FETZER 22 MONACO AVE ELMONT, N.Y. 11003 TURBO}-BASIC DOCUMENTATION INDEX =============================== NAME PAGE ---- ---- } ARITHMETIC 29 ARRAYS 33 *B 12 BGET 5 BLOAD } 2 BOOLEAN LOGIC 31 BPUT 4 BRUN 2 CIRCLE 26 } CLS 6 CLS #n 6 COMPUTERS 1 DEC 30 DEL } 8 DELETE 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 ERRO}R 28 29 ERROR 29 29 ERROR 30 29 ERROR CODES 28 EXOR } 32 *F 11 FCOLOR 27 FETZER, RON 34 FILLTO 27 FR}AC 30 GENERAL PROGRAM 6 %GET 6 GET name 15 GO #name } 14 GO TO 11 GRAPHICS 26 HEX$ 29 IF-ELSE-ENDIF 24, 33 } INKEY$ 21 INPUT 10 INSTR 21 *L 11 LINE LABELS} 13 LIST n 16 LOADING 1 LOCK 3 LOOPS & SUBROUTINES 23 } MEMORY 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 SLEF-BOOTING 32 SORT 34 } SOUND 19 STRING SORTING 34 TEXT 28 TIME 19 TIME$ } 20 TRACE 9 TRAP #name 19 TRUNC 31 UINSTR 22 } UNDERSCORE 14, 33 UNLOCK 3 USEABLE RAM 1 VARIABLE LABLES 14 VARIABL}ES NUMBERS 1 WHILE-WEND 23 ! 32 & 32 %0 - %3 2}8 -- 13 23 ! 32 & 32 %0 - %3 2"