Radio tiimi TRS-80: April, 1981 P.O. Box 29 10, Fort Worth, Texas 76 10 1 jft THE MICROCOMPUTER NEWSLETTER PUBLISHED FOR TRS-80 OWNERS Newsletter Index In This Issue ... Color Computer Color Castle Product line Manager's Page . . Computer Club Education Products A Commitment to Education . . Marketing Information Service Model I/III Bugs, Erors, and Fixes Accounts Payable (26-1554) Adv. Stat. Analys. (26-1705) Business Mail List (26-1558) Disk Payroll (26-1556) . . Real Estate V. I (26-1571) Standard & Poor's (26-1507) Tape Mailing List (26-1503) TRSDOS 1.2 (Model III) . . . CLOADKBFDC Johnson/Caire Screen Print Planting Seeds Product line Manager's Page QuickAdder Sort Routine Modification ModelH Bugs, Errors, and Fixes Accounts Payable (26-4505) 8 General Ledger (26-4501) 8 Inventory Management (26-4502) .... 8 Payroll (26-4503) 8 SCRIPSIT (26-4530) 8 TRSDOS 2.0 and 2.0a 7 Ideas . 9 Product Line Manager's Page 7 Screen Dump, Revisited 10 UNPATCH/BAS 10 Notes on Previous Newsletters December 1980 1 January 1981 20 Peripherals Mysterious line Feed 9 Product Line Manager's Page 16 Pocket Computer Gas Mileage 14 Memory Aide 15 Programmable Timer 14 Simple Planetary 15 Telephone Book 14 String Along With String$ ...... 6 View From the 7th Floor 2 Volume 3, Issue 4 13 11 1 .18 , 1 &'"&■ ,'-.'. >''*'& \:&^ /^r f^&'l '->./* '- RADIO SHACK ANNOUNCES AGRICULTURES FIRST ELECTRONICS MARKETING INFORMATION SERVICE Computer Club Southern Maine TRS-80 Group 15 Mountain View Road Cape Elizabeth, ME 04107 207/767-2351 or 207/797-4898 Tandy Corporation/Radio Shack, in a joint announcement with Professional Farmers of America, in Chicago recently revealed plans for agriculture's first elec- tronic marketing information service. Called Instant Update, the service pro- vides farmers and agribusinessmen immediate access to the market-making events that affect commodity prices, crop yields and other data important to improving farmers' business activities. Instant Update information will be transmitted via telephone lines to VIDEO- TEX terminals specially made by Tandy Corporation/Radio Shack for the Profes- sional Farmers of America program. "The Radio Shack VIDEOTEX system was selected because of its technology and cost effectiveness," stated Charles Phillips, senior vice president of Special Markets for Radio Shack. This Radio Shack terminal utilizes standard tele- phone lines and a standard television set (Continued on Page 20) Notes on Previous Newsletters Mr. J. Michael Healy of Bimiingham, AL recently sent us this note: "I would like to tell you how much I enjoy your NEWSletter and I am enclos- ing a program change for the Base Con- version program (12/80) which makes the binary printout much easier to read. This change inserts a space between each four digits (nibble) of the binary conver- sion. It involves changing only one line [300] and adding lines [301-306] and [611-613]. I use this program for pro- gramming EPABX's (Telephone Com- puters) and it has made the printout much easier to work with. I have a Model II and a Line Printer IV and am very pleased with both. Remember our battle cry: WE HAVE ONLY BEGUN TO PROGRAM!!!" (Continued on Page 20) Retail prices in this newsletter may vary at individual stores and dealers. 4 The company cannot be liable for pictorial and typographical inaccuracies. maam — w&BL V! w From the 7th ] by Jon Shirley, Vice President Computer Division I am going to break my own rule and announce a new product before it's avail- able. Soon we will offer disk drive head cleaner kits for both the SVa and 8 inch drives. They will sell for $29.95 each and contain two cleaning diskettes and a bot- tle of cleaner. Each diskette can be used 13 times so at once a week you get a half years life per kit. There are some other head cleaning kits on the market but we picked this one by getting our 3 major drive suppliers to test every brand we could find and tell us which one abso- lutely would not damage the head or the pad. They certified only one and that's the one we will offer. I strongly recommend that every disk drive user get a kit and use it. If you are a light user clean the heads every two weeks and get a full year's pro- tection of your data for only thirty bucks. That is cheap protection. There seems to be a little confusion about the disk drives used in the Model III, judging from some articles I have read and some of your letters. The drives in the Model III are based on the Tandon design but they are manufactured from the ground up at Texas Peripherals in Odessa, Texas. The T.P. drives are 40 track and use a band actuator for fast head stepping. Texas Peripherals is a joint venture (50/ 50) of Datapoint Corporation and Tandy Corporation. There are 150 employees at Texas Peripherals and it was the first new industrial plant opened there in over 20 years. In case you have never been to west Texas, the whole place floats on OIL and almost all the local industry is concerned with oil exploration, drilling, storage etc. While on the subject of the Model III I have noticed some enterprising types are now selling built-in drive kits for the Model III. When a Model III is expanded to one (or two) internal drives a lot of stuff is packed inside. Included are a disk con- troller board, another switching power supply, molded brackets to hold the drives, shielding to protect the drives and to maintain FCC compliance, cables to hook the whole thing up and, of course, the drive(s). If one of these non-Radio Shack kits tempts you to buy, you should be aware of two potential problems. First of all none of these kits are FCC certified as of February 14 when I am writing this. None of them have even been submitted to the FCC. So if you have one of these installed it is very likely that your Model III will not continue to meet FCC regulations. The FCC will enforce its rules and either require compliance or stop the seller but it will take time. The second problem that you will face is that we will not service your Model III with a brand X controller and drives and power supply inside. We are not being anti-free enterprise, mean or greedy, just practical. When a disk con- troller is installed it becomes an integral part of the entire computer and can effect its performance even in non-disk opera- tions. Adding a disk controller is NOT like putting different tires on a car, its like replacing the entire intake manifold, car- buretor and all. Do it wrong and you will bum valves (or worse). Since all our diag- nostics for a disk system are disk based we would have no way of knowing what is creating the problem and of course we do not stock parts for non-Radio Shack products. So if you must buy a brand X kit be sure you can get service! We hear about all sorts of different applications for the various TRS-80's and from time to time I would like to share some of them with you. For instance there is a talented programmer in Canada who has produced a very good scoring program for sailboat regattas. It runs on a 32K 2 disk Model I and really does it all. We used it here in Fort Worth this fall to score the World Youth championships which were sailed on Lasers and Laser 2s. (Bet you did not know we have a world class Yacht Club in the middle of Texas!) If any of you would like information on this program drop me a line . . . it's a personal recommendation as I set up the system here. Another interesting sports applica- tion came to our attention from a news release put out by the Milwaukee Bucks of the National Basketball Association. They tell the story as follows. The Milwaukee Bucks of the National Basketball Association have stepped into the computer age with a microcomputer that continuously com- piles, displays, and prints player and team statistics during the course of the game. The Bucks organization has taken a big step into the modem age this season with the acquisition of a new computer- ized statistical scoring system. California based Sports Stats U.S.A. has designated their system the SS 100 Basketball Scoring System. The SS100 system consists of a standard off-the-shelf office computer purchased from Radio Shack (TRS-80 — Model III) and a special basketball data entry computer keyboard and computer software programs from Sports Stats U.S.A. The system has virtually replaced pen, pencil and paper; strained eyes and cramped fingers with the miracle of micro-circuitry. For years, keeping stats frieant hash marks on a scorecard, add- ing columns, and filling out a box score by hand. The next morning, after the game, it was back to the office, pencil in hand, erasers aplenty, to add up team and indi- vidual highs and lows, check career marks, type up the results, and otherwise spend hours in the pursuit of a peculiar American sports pre-occupation known as " statistics ." This year, in contrast, all of the above is being done with the touch of a button. Stats are totaled and printed in box score form seconds after the game-ending horn. Later, the computer can produce all the cumulative and comparative data, as well as season highs and lows, in printed form suitable for reproduction and use in future press notes and news releases. Cumulative statistics are now compiled and printed in the time it used to take to complete a box score. Accurate up-to- the-second game statistics are displayed by the computer on video monitors to assist radio and television broadcasters in calling the game. During timeouts, and between quarters, quickie stats are printed and distributed. Comprehensive box scores are printed at half time and post game. "The system is light years ahead of how we used to compile statistics," said Bucks' Publicity Director Bill Ring II. 'The amount of information immediately avail- able both on video monitors and through printed reports was heretofore not possi- ble. But with the aid of the Sport Stats sys- tem we can virtually overwhelm even the most statistical oriented sports reporters and fans." "The system has a very high profile courtside while it saves valuable office time for me," continued King. "The com- puter has allowed us to redefine the role and importance of keeping statistics by minimizing the vast amount of time required to compile statistics." According to Sport Stats spokesman, Jim McCabe, the real advantage and rev- olutionary nature of computerized scoring lies in the itinerant speed, accuracy, and video display capabilities of the computer. (Continued on Page 17) 2 Microcomputer NEWS, April 1981 Model I/HI Product Line Manager's News When you read my first comment that the Model III included the "best" of Model I plus a lot more it was a cold January. We started looking then at the additions to the Model III and now we are already into the Spring. I will have to stop this discussion soon because we have a stack of new products to introduce to you, but let's cover some more Model III additions. DISK BASIC Editing your programs is a snap with: 4* Prints the previous program line on the screen ^h Prints the next line Prints the current line Edit the current line (SHIFT ) ^ Prints the first line (SHIFT) ^ Z Prints the last line (left (SHIFT) key only) Lxx list line xx Exx Edit line xx Dxx Delete line xx Axx, inc Auto insert beginning at line xx DOS The DO file is a time saver and is also one of the most ver- satile tools that we have added for the applications programmer. You will find plenty of uses for this special file which is first created with the BUILD command. Put TRSDOS library commands or applications programs in the DO file in the order that you want them to execute. Then kick off the sequence with DO" filename" where "filename" is a DO file previously developed with BUILD. It's great for things like preparing a series of listings while you are at lunch, killing transaction files, initializing a communications channel before starting a session, beginning an application by set- ting FORMS for the printer, or initiating WP for protecting program files. Of course the major benefit of the feature is to insulate an operator from the processing procedures that would normally be required to use a business application. DO files also insure that the procedures are followed properly, cutting down on frustration and lost time. Here is an example of the way it would work: First from TRSDOS Ready, type BUILD EXAMPLE. You will then be prompted to type in up to 63 characters on each line to describe commands, or to provide text that will be used for input to a running program. When you are finished exit with the (BREAK) key and the commands will be saved in a "DO file" (which in this case is called EXAMPLE). You could have next typed AUTO DO EXAMPLE — Now when you reset or power up, a DO activ- ity will begin. The "DO file" EXAMPLE provides automatic com- mand input and will execute each command shown without any intervention from the keyboard (other than stopping for your INPUT requests from BASIC). Note that BASIC applications can be run from a DO file including automatic input of information normally entered from the keyboard. In those cases, the responses to the BASIC applications questions thru use of BASIC INPUT statements are saved in the DO file along with the name of the applications to be run. Take a look: (For clarity, we underlined the parts which you would enter from the keyboard.) BUILD EXAMPLE (FnTER) Hit BREAK to exit Type in up to G 3 C h a r a c t e rs SETCOM (BAUD=i2g)g),NAIT ) (ENTTO Type in up to 63 Cha racters FORMS (NIDTH = 80 (ENTER) Type in up to S3 Characters PAUSE INITIALIZING SERIAL INTERFACE AND PRINTER (ENTER) Type i ri u p to G3 Characters BASIC (ENTER) Type in up to 63 Characters (ENTED T y p e in up to S3 Characters ( INTER) Type in up to S3 Characters RUN"HIST0GRA/BA5" (ENTER) Type in up to S3 Characters (BREAK) TRSDOS Ready Now, to see how it works type: DO EXAMPLE (ENTER) TRSDOS Ready SETCOM (BAUD=1200 ,WAIT) BAUD = 1200, WORD - 8* STOP - 1, PARITY = NONE, WAIT MODE TRSDOS Ready FORMS (WIDTH=80) TRSDOS Ready PAUSE (INITIALIZING SERIAL INTERFACE AND PRINTER) INITIALIZING SERIAL INTERFACE AND PRINTER Press to c o n t i n u e CENTER) TRSDOS Ready BASIC How Many Files? Memory Size? TRS-80 Model III Disk BASIC Reu 1*2 (c)(p) 1980 by Tandy Corp* All Rights Reserued* Created 5-Jul-80 2170G Free Bytes 3 Files READY >RUN"HISTOGRA/BAS" HISTOGRAM . . . (The program would continue from here, with inputs from the keyboard as usual.) MODEL I/III Potpourri A few comments ... In answer to some of the predominant questions coming in about VisiCalc. You can use the Model III CONVERT utility on a Model I VisiCalc disk to transfer VisiCalc data files that were originally set up on your Model I. But transfer them to a Model III VisiCalc disk. Model I VisiCalc was not designed to run on a Model III and it won't. Accessing VisiCalc data files from BASIC is described in a document available at no charge as 700- 2220. It is a VisiCalc addendum describing the Data Interchange Format . . . The LPC printer driver is now on the Model III TRSDOS disk as well as available for Model I (700-2007). Make sure that you read the Peripheral Product Line Manager's page this month for an understanding of the purpose of the LPC driver ... A recent comment was made that RS software packages include instruc- tions on user changes to make them run on Model Ill's. Not so — We have an exchange program available if you get a package without a III compatible tape or disk (if it is needed). In fact we have reworked our stock to include these tapes and disks so you won't need to get involved in any "user" changes. We do include (Continued on Page 4) Microcomputer NEWS, April 1981 3 Radio /haek® ■The biggest name in little computers' m> Model I/III <*«»** » a pamphlet with your Model III entitled "Instructions for Convert- ing Specified Model I Programs for use on TRS-80 Model III" The changes in that pamphlet are "optional," since tapes or disks are available (with the changes already made) for those programs which are shown. The changes are given for your convenience since many of you already own our most popular cassette soft- ware and may prefer to modify these yourselves . . . If you have used the SAVE command with the ASCII option to save a BASIC program — SAVE ftlespec, A— rather than the compressed format then you may have gotten the error message " DIRECT STATEMENT IN FILE ." This is caused by lines which exceed 255 bytes. Make sure you save your program first without the ,A option as you are liable to lose your program otherwise. To avoid the problem remember that the 255 byte maximum includes the line number digits and the space following the line number, all the characters and spaces in the line itself and 2 bytes for each line feed. Model I/III Bugs, Errors and Fixes ModelIIITRSDOS1.2 On page 79 of the Model III TRSDOS manual, it states that the number given to the "LINES = 'bbb'" option is "the maximum number of lines to print before an automatic form feed . . .". This is not so. In Model III TRSDOS 1.2, when the maximum number of lines is reached, the line counter restarts at one and NO automatic eject is done. The lines counter serves only to tell the printer driver how many lines have been printed since the last top-of-form. It is the responsibility of the programmer to examine the line counter at location 4029 Hex (16425 decimal) to determine if it is time to send the printer driver a top-of-form character (decimal 12) to eject -the paper. The manual is also in error when it states, about the LINES option, "... If omitted, 60 is used . . .". If no entry is made, what- ever the maximum lines counter has in it will remain unchanged. The power-up default is 60, but after power-up, if the value is changed for any reason, you will need to specify 60 if that is the number of lines you need. Also in the Model III TRSDOS 1.2 manual, under the section on Fundamental TRSDOS I/O Calls, pages 124 and 125, it should be noted that the OPEN and INIT TRSDOS I/O calls destroy the contents of the IY register. This is a bug in TRSDOS 1.2 and is scheduled to be corrected in the next release of Model III TRSDOS. Until then, if you are using the TRSDOS I/O calls in your machine language routines, remember to save and restore the contents of IY before and after a CALL to INIT or OPEN. Tape Mailing List (26-1503) In versions 3.0 and earlier, when printing labels the line- feeds are off and the labels print incorrectly To correct this problem, make the following changes to the program: 19010 LPRINTFI$(I ,2) :LPRINTFI$( I #3) 5 " "5 FI$( I t 4) 5"-" 3FI$(I ,5) : LPRINT" " : LPRINT" " 19015 IFE = 0THENLPRINT' ! "sELSEIF FI$( I »1) = ,, "THENLPRINT" " Standard & Poor's Stockpak® (26-1507) You may receive a "FILE FULL" message when you try to add the 31st stock. To correct this, follow this procedure: 1) Go to the security entry part of the program and DELETE the 31st ticker that you just added. 2) ADD a ticker XXX, with a dividend rate of 0.00, X-date 00/00/00, current price 0.000, PE Ratio 0.00, S & P index 0.00 3) After entering this dummy ticker, you should be able to proceed as usual. Accounts Payable (26-1554) In version 3.0 only, the program will not print or subtract the discount from the amount of the Cash Requirement Report. The checks are subtracted when printed. To correct this problem, make the following changes to the REPORTS program: 173 IU$=Il$sD=ABS(CUI(I2$) ) : G0SUBG1 : DA$=D$ : D= ABB(CUI(I3$) ) :DU=D:G05UB6i:DU$=D$:D=CUI G05UBG 1 s DD$ = D$ : U$= 1 5$ : G0SUB57 : Al = A : V$= I B$ : G0SUB57 : A2 = A : V$ = I7$:G0SUB57:A3=A:V*=I8*:G0SUB57:A4=A: V$=I9$sG0SUB57:A5=A Disk Payroll (26-1556) Computer Services has received new state tax tables for Mis- sissippi, Nebraska and New York. If you need these new tax tables, contact Computer Services (Address and phone numbers on the back page of the Newsletter). Business Mailing List (26-1558) New version 3.0 copies of this program should be available. These new versions include the ability to print two "up" (across) labels. The Model I version is 700-221 1 and the Model III version is 700-2212. This new version is available free to current owners of 26- 1558. You will be required to exchange your ORIGINAL pro- gram disk for the new version diskette. Real Estate Vol. I (26-1571) In the "Rate of Return" program, the modified internal rate incorrectlY equals regular internal rate of return. To correct this, the following change should be made to the "Rate of Return" program: 800 R1=R1+R2 1T0D1-1: iD9=0:D0=C:D0 ONAGOTOS10 =D0-(D0*R3) :F0RI= 820 Advanced Statistical Analysis (264705) In Time Series II, a "subscript out of range error" may occur. To correct this, make the following changes: DELETE line 1090 1060 GOSUB6000: JJ=0 : F0RJ= 1T08 : JJ=JJ+1 : IFZ ( J)="@" N(K)=M+JJ-i: JL=J:GOSUB7000:JJ= 0:K = K + 1 : IFMT = 3ri = M-JL 10090 E=0: KL=1 :F0RK=1T0NT: E=E+1:IFZD(K)= "B"THEN KL=KL+1: E=E- 1 : GOTO10100 ; ELSE IFZI="Y"LPRINT "ELEMENT #" 5 E t "GROUP #" 5 KL>ZD(K) 10085 PRINT"ELEMENT #" 5E# "GROUP #" 5KL*ZD(K) SGOSUB8900 Note that we added a large section in the middle of line 10090 and "chopped off' the end of line 10095. 4 Microcomputer NEWS, April 1981 Radio /haek ■The biggest name in little computers ® Johnson/Caire Screen Print Routine Mr. John P. Caire, Jr. of Hamden, CT recently purchased a line Printer IV for his Level II 48K Model I TRS-80. Mr. Caire has provided us with a modified version of Myron F. Johnson's Screen Print Routine (Jan/Feb 1980). Mr. Caire's modification corrects a small problem which the original version had, allows it to print lower case, automatically puts the printer in 132 column mode for the graph, then returns the printer to 80 column mode. Here is the Johnson/Caire routine: 2200 K'Jf. = B 2210 FOR Y'/, = TO 47 2220 P$= !l " 2230 FOR >(7, = TO 127 2240 IF P0lUT(X%t\'Z) THEN P$ = P$+ "#" ELSE P$=P$+ » " 2250 NEXT XI 2260 IFINT( (Y'Z/3)-. 1 ) = (YZ-1 )/3 THEN GOTO 2330 ELSE 2270 2270 LPRINT CHR$(27)5 CHR$(20)5 P$ 2280 NEXT YZ 2290 K'Jf. = B 2300 LPRINT CHR$(27)5 CHR$(1S) 2310 RETURN 2320 END 2330 KZ=K%+i: Q$=""s R$= M " 2340 FOR LZ=0 TO S3 2350 AZ=PEEK( 153S0+ LZ+ (S4* 23G0 IF A7,<=32 THEN AX = 32sG0T0 2380 2370 IF A"/,= >128 THEN A'/, = 32 2380 Q$ = Q$+ CHR$(A'/,) + " " 2380 NEXT LI 2400 FOR N'/,= l TO 128 2410 IF MID$(Q$* MX* 1) <> " " THEN R$ = R$ + MID$(0$»MZtl) ELSE R$=R*+ MID$( P* *M% t I ) 2420 NEXT HI 2430 LPRINT R$ 2440 GOTO 2280 2450 END If you have an upper-case only printer, Mr. Caire suggests you add line 2365: 23S5 IF A%=> 97 AND AZO 127 THEN AZ = A%-32: GOTO 2380 Happy graphics! 90 DATA 175* 17, 10* 0* 205 t 11* 0* 25* 34* 22* B4 100 DATA 205* 97* 27* 195* 25* 2S * 33* 54* B4 * 1 110 DATA 1* 58* 22* 0* 10* 95* 174* 115* 163* 32* 8 120 DATA 20* 44* 203* 1* 242* 228* 127* 201* 95* 197 130 DATA 1* 220* 5* 205* 9S * 0* 193* 10* 1S3* 200* 195 140 DATA 251 * 3 Sort Modification Mr. Konrad Kuzmanoff of Ohio State University sent us this modification to our machine language sort routine (July 1980): "I found the machine language sort published in the July issue of the TRS-80 newsletter most useful. I especially appreciate the additions that you mention in the November issue. "You may be interested in printing the following modification which allows one to load the sorting routine from the DOS. The modification protects the sort routine by changing the high mem- ory pointer at &H4049. To put the sort on disk: 1. Load and run the BASIC program. 2. Return to the DOS. (CMD " 5") 3. CaH up DEBUG. (DEBUG (ENTER) ) 4. Use the memory modification to insert the following code at &HFFCB (MFFCB): 21 FF FE 22 49 40 C3 2D 40 5. Return to the DOS (G 4 (3 2 D CENTER)) 6. CaHup TAPEDISK. (TAPEDISK (ENTER) ) Note: Yo u will s till be in DEBUG. To execute TAPEDISK, press ® (ENTER) . The TAPEDISK prompt (a question mark '?') will appear. 7. Under TAPEDISK type: F SORT/CMDS0 FF00 FFD5 FFCB (ENTER) CLOAD KBFK Mr. Bob Pollock sent us this information: "For those of us that still have problems with the old ROM Level II keybounce problem, here is your KBFIX program rewrit- ten in BASIC On power-up, respond to MEMORY SIZE with 327 12. CLOAD this BASIC program, then run it. If you have keyed in the program correctly, the computer will go directly into SYS- TEM mode. Activate the debounce program by responding /32713. "This is (a) faster loading program than the machine lan- guage version." Here is Mr. Pollack's program for 16K Level II Model I's: 5 REM KBFIX PROGRAM FOR 1GK* LOAD AND RUN TO FIX KEY BOUNCE. 10 DEFINT A-Z 20 FOR 1=1 TO 55 30 READ J 40 POKE 32712+ I * J 50 K= K+ J 60 NEXT I 70 IF K<> 4864 THEN PRINT "BAD LOAD" ELSE CLS: SYSTEM 80 END 8. Return to the DOS. (E (INTER) ) "The sort routine is now saved as SORT/CMD, and can be loaded from the DOS simply by entering the command 'SORT.' The sort routine will be loaded, high memory will be set to protect it, and you will be returned to the DOS." Editors Notes: This modification is for Disk based Model I computers only. Model III Disk users should check their TRSDOS manual for information on using the DUMP utility to transfer the machine code from RAM to disk. Please note that in the TAPEDISK command above, 'FF00' is the START address, TFD5' is the END address, and 'FFCB' is the TRAnsfer address. There is no relocation of the code. The modification given above works for a 48K system. If you have a 32K system change the third pair of values in the memory modification from "FE" to "BE." You should also change the 'FF's in the TAPEDISK command to 'BF's. For a 16K system, change the 'FE' to 7E,' and change the *FF's to 7F's. The modification allows you to load the machine language program directly from DOS, without having to use the DATA state- ments. To see that this works, modify the sample program given in the July News by DELETEing line 60 and all lines from 1000 to the end of the program (make sure you save a BACKUP of the original program, just in case something goes wrong). This will allow you to execute the sort demonstration program, but the program will never have to call the sort load subroutine. From DOS, follow this procedure after you have created SORT/CMD and modified the demo program: 1. Type: SORT (ENTER) 2. When DOS READY appears type: BASIC (ENTER) 3. Press (INTER) for both the Files and Memory Size questions. (Continued on Page 6) Microcomputer NEWS, April 1981 5 Radio /haek® The biggest name in little contptiters® Sort Modification (FromPages) 4. Type: RUN " SORT /B AS" (MM (use your program name!) I used this change in a 48K Model I and the program handled 1500 strings very well. This change lets you forget about Memory Size, which I find to be a very useful feature. If you would like to use this procedure with the two dimen- sional sort routine we published in March 1981, here is the infor- mation you need: For a 16K machine, the code to add using M7FEE is: 21 DE 7E 22 49 40 C3 2D 40 For 32K change the 7E' to 'BE' and modify memory begin- ning at Hex BFEE. For 48K change the 7E' to 'FE' and modify memory beginning at Hex FFEE. The TAPEDISK command for 16K would be: F SORT2D/CMDS0 7EDF 7FF7 7FEE For 32K, change the 7E' to 'BE' and the two 7F's to *BF: For 48K change the 7E* to 'FE' and the two 7F's to TF: PLANTING SEEDS The random number generator in the TRS-80 Model I and Model III can be reinitialized or "reseeded" so that the RND func- tion will return a repeatable sequence of random numbers. One typical use for a predictable sequence of random num- bers is computer generated tests. After initializing the random number generator, the sequence of test questions would be deter- mined using the RND function. The correct answer list for each test could then be generated by reseeding the random number generator with the same value used to initialize it. Reseeding the random number generator simply requires POKHng three memory locations with a number from to 255. All three locations must be POKEd to produce a repeatable sequence. The memory locations are 16554, 16555, and 16556. The example below shows how it's done: 10 INPUT "PLEASE ENTER YOUR NANE"5N$ 20 IF LEN ) 330 NEXT Z 340 RETURN Quick Adder Here is a portion of a letter we received recently from Richard Moskovitz of Carnegie, PA: "... I just had need to add several short columns of figures, and went to the adding machine to do the job. After adding only 3 of the 50 or more columns, I thought there must be a better way. I went to my trusty TRS-80 and wrote the short program attached. I have the 10-key pad attached so input is very quick. While there is nothing spectacular in the program, it Med a need that I had right then. The program is as follows: 100 CLS 110 LINEINPUT n ENTER A NUMBER "5A* 120 IF A$="" THEN B=0 ELSE B= B+ MAL(A$) 130 PRINTTAB(35> "SUBTOTAL"; USING 140 GO TO 110 150 END "As you can see from line 110, I have Disk BASIC. (I also have SCRIPSrT which I find to be fantastic). The reason I use A$ as a string for the input is so I can test for a null enter. "I have to add, at different times, items that have thousands only and also items that have dollars and cents. I find that the ### following the . in line 130 allows for the inputting of the thousands without repeating all the zeros. In other words, 10,000 is input as 10. A figure like 10,245 would be input as 10.245. Now the decimal point in the answer is used for the comma of the thousands. When I am adding dollars and cents, the extra zero (third place of the decimal value) is not annoying. "The purpose of testing for a null string (in line 120) is to all ow for the totaling of one set of figures and the start of the next. A (ENTER) only, without any figure input, will cause the value of B to be reset to zero allowing for the start of a new column of figures ..." Editor's Note: For non-Disk BASIC users, change line 110 to read: 110 A$= INPUT"ENTER A NUMBER "5 A$ String Along With STRINGS The following article is reprinted from the Jan. 1981 newslet- ter printed by the Radio Shack Computer Center in South Roch- ester, NY: One statement, which is often overlooked in LEVEL II BASIC, is STRINGS. The format of STRINGS looks like this: STRING$(n, c) where "n" is a number which indicates how many times you want a character repeated and "c" describes the character. The character can be identified in two ways. It can be identified by using the ASCII code number for that character (par ex: A = 65) or it can be the character itself, enclosed in quotes ("A"). Thus, either of these expressions would print the character "A" 48 times: PRINT STRING$ "Z")5 STRING$(W* 140)? STRING$(Tfl7G) 60 PRINT "SLEEP"? TAB(S) "WORK" 5 TABCS+W) "TO" Obviously this little program does not accurately graph what you do all day, but it illustrates a point — that STRINGS can be used to draw clever graphs. In this program, the "day" has been scaled up so that 48 positions on the screen represent the 24 hours of the day. Thus in line 40, each one of your entries is mul- tiplied by 2 to bring them up to scale. The remainder of the day, which we assume is devoted to sleep, is calculated by subtracting the sum of your (doubled) entries from 48. The numbers 140 and 176 which appear inside the parentheses in line 50 produce graphics characters which print narrow, solid lines. Editor's Note: STRINGS is available in Model I Level II and Disk BASIC, Model III BASIC and Disk BASIC, Model II BASIC, Model II Compiler BASIC, and Extended Color BASIC Q Microcomputer NEWS, April 1981 Model II Product Line Manager's News INTERFACING PROFILE ANDSCRIPSIT. If you have at least two disk drives on your MOD-II and own either PROFILE or SCRIPS3T, do yourself a favor and look into the capabilities of the other. If you do not have an external drive, you may find that the combination of PROFILE / SCRIPSIT could make the purchase of a second drive a worthwhile investment. PROFILE has the ability to spin off a SELECT file of merge data from your data base. A SELECT file is a special file which can be used by SCRIPSIT for merging information into standard forms or letters. To do this you specify the header names that you want to use as SCRIPSIT keywords, then the field numbers of the data you want blend into a SCRIPSIT form or letter. Now you select the records from PROFILE by up to sixteen criteria and create a disk file that contains the SCRIPSIT key words and the data to be merged. An example? OK. Lets use PROFILE as a membership, dues, mailing list. Your PROFILE records might contain a FIRST NAME, LAST NAME, ADDRESS, CITY, STATE, ZIP, MEMBERSHIP NUM- BER, DATE DUE, DATE LAST PAID, AMOUNT DUE and AMOUNT LAST PAID. We don't want or need all of this information to appear in the letter so the SELECT format would be: FNAME LNAME ADDRESS CITY STATE ZIP DATE DUE AMOUNT DUE When you specify which data is to be spun-off, you would select on AMOUNT DUE GT (greater than zero). If PROFILE finds any records with the AMOUNT DUE greater than zero it will write the items specified in the SELECT format to the MERGE file. The MEMBERSHIP NUMBER, AMOUNT LAST PAID, DATE LAST PAID etc. would not be in that MERGE file. Now, to SCRIPSIT for the form letter. The letter would be typed into SCRIPSIT as follows: MR {LNAME} {ADDRESS} {CITY}, {STATE} {ZIP} Dear Mr. {LNAME} Our records indicate that your membership dues of {AMOUNT DUE} were past due on {DATE DUE}. Please remit your payment to keep your membership in good standing. THANKYOU, Club Treasurer Printing the letter will give you a proof copy exactly as you type it in, including the braces and LNAME. These are the same keywords you used in the selection format of PROFILE. Instead of printing the letter, you can ask for a merge. SCRIP- SIT will ask for the filename of the MERGE file. In this case, it would be the PROFILE select file but could be the MAILING LIST (26-4507) or a data file from a program you have written. After you enter the file name and press (ESC), SCRIPSIT will scan the merge file, match the first block of keywords with the form letter in SCRIPSIT for position within the data block then read in the next data block, the keywords in the form letter are replaced with data from PROFILE, the letter is reformatted to compensate for the different lengths of data, such as a long or short last name, and the letter is printed. This advantage becomes even more obvious if the names are used in the body of the letter. Each letter will appear as if it were custom typed for each person it is sent to, but you only typed the letter one time. That same letter is still available to be used next month. Updating your PROFILE data base and running the SELECT program will provide you with the next current set of data for the letter. Also, the letters could be printed in alphabetical or zip code order if you requested the data to be sorted. Model II Bugs, Errors and TRSDOS 2.0 AND 2.0a The following sets of patches should be made to Model II TRSDOS 2.0 and 2.0a: 1. For some ranges of values, the "RAM Directory" Supervi- sor call (#53) has returned an erroneous value for the number of records in the file. This is caused by an invalid offset in one of the operands used in the calculation. The following patch is for TRSDOS 2.0 and 2.0a only and will correct the code involved in the calculation. All three patches must be applied: R = 59 B=103 F = B528H C=CD992S R = 59 B=12(3 F=CF5DEB C = CD9F2B R=B0 B=i54 F=E5E5E5E5E5E5E5E5E5E5E5 J>B5CA7A252BC9CF5D13EBC9 2. In some cases, when using the PATCH utility to modify a byte, an erroneous 'String not found — Abort' message would be returned, even when a LIST of the file would confirm the presence of the byte to be patched at the address specified. This was caused by an invalid compare when the target byte was at the beginning of a sector. To observe the problem, attempt the following patch: PATCH PATCH A = 29S3 F = 7E C = 7E (Continued on Page 8) Microcomputer NEWS, April 1981 "J PATCH SYSTEM/SYS PATCH SYSTEM/SYS PATCH SYSTEM/SYS ladie/haek® ■The biggest name in little computers <3> [od II Bugs, etc. (From Page 7) (The 7E' byte is the first byte in the second sector of PATCH.) The following patch is for TRSDOS 2.0 and 2.0a only and will correct the symptom described above. PATCH PATCH A=32S3 F=B79932A5323AA432321933CD C=9132A5323AA432321933B7C4 When a file uses the last (96th) directory entry, it is possible, in some cases, to be able to see the file listed in the directory, but any attempt to access the file by name will result in an invalid error 24: 'File Not Found.' The following patch is for TRSDOS 2.0 and 2.0a only and will correct the symptom described above. Both patches must be applied: PATCH SYSRES/SYS A=iG82 F=5F C = G0 PATCH SYSRES/SYS A=1G99 F = 03 C = 00 General Ledger (26-4501) In version 1.2, an extra Top-of-Form may occur when you are doing a two page asset and liability balance sheet. To correct this, change line 1275 of the "Glbalshf program to read: 1275 IFM=2ANDL>4THENP=1 ; GOSUB430 s P = S0 In versions 1.0 — 1.2 of General Ledger, if you wish to change the month that your system is running in, use the follow- ing procedure: 1) Go into A ccounts Maintenance 2) Press the (BREAK! Key 3) Type F M = the # of t he month CENTEW) 4)TypeC0NT (ENTER) 5) Press the (FT) key 6) Go to System Status and check the month to be sure it is correct. If the General Ledger's year is closed out, and it was not in the 12th month, System Status does not reset to one. To fix this problem, follow this procedure: 1) LOAD" Income" (ENTER) 2) Type in 1430 FM = ( Z) (ENTER) 3) SAME" Income" (iNTERl Inventory Management (26-4502) After one year of running Inventory Management, the sug- gested order list is supposed to be automatically switched to the zero base ordering. We have found that it is two months off in versions 1.0 and 1.1 Make the following changes in "ORDER/BAS": Version 1.0 — Line 7710 should read: 7710 Y=P:IFNY=12THEN0P= IF0P<1THEN0P=0P+15 PH+1ELSE0P=PH-NY: ADD line 7715: 7715 X = 0P Version 1.1 — Line 7710 should read: 7710 Y = P! s IFNY=12THEN0P=PH+iELSE0P=PH-hh IF0P<1THEN0P=0P+12 ADD line 7715: 7715 X=0P Payroll (26-4503) Computer Services has received new state tax tables for Mississippi, Nebraska and New York. If you need these new tax tables, contact Computer Services (Address and phone numbers on the back page of the newsletter.) In version 1. 1 of the Payroll program, the employee's subject FICA wages will be incorrect in some cases. In the version 1.1 "W2" program, change line 1700 to read: 1700 LPRINTsLPRINTTAB(B) 5NA$?TAB(40) 5 USINGFI$; REa(l) ; :LPRINTTAB(55) S USINGFI*5RE#< 1 ) ~RE#(5) Accounts Payable (26-4505) When a vendor is completely paid off, the balance in the account should be zero. Instead, it may be one cent. Check all invoices and make sure that they are correct. To correct the problem, change the following lines in the "APCHECK/BAS" program: 700 W# = ABS(N#)*100sM$= M " :X = Wtt/Dl* :l4* = lAl*- X*D 1 # : U$=U$+CHR$ ( X- ( N#< ) * 1 28 ) 702 X = Ws/D2*; W#=.Wa-X*D2a:M$ = U$ + CHR$(X> =N*/D3«:M*=FIX(M*- 704 M$ - X # D 3 # ) s = Y$ + CHR$ ( X ) +CHR* < W* ) : RETURN Scrips!! (26-4530) If you have version 1.0 of Scripsit, there are two sets of changes which should be made. The first problem is that the Repaginate function may wipe out and/or scramble your docu- ments. The second proble m is that when an alignment tab is terminated with an (ENTER) instead of a period, Scripsit will not accept the (ENTER) as a valid command. To fix these problems, follow this procedure: 1. Reset the computer and insert a Scripsit diskette. 2. Answer t he DAT E prompt with the current date. 3. Press the (HOLD) key. 4. Answer or skip the TIME prompt. 5. The repaginate problem is fixed with the following four patches: PATCH SCRIPSIT/G A=E094 F=0F C = 05 PATCH SCRIPSIT/G A=E235 F=CS5SSF C=C310DC PATCH SCRIPSIT A=DC10 F=00000000000000 C=BF2006210057C3 PATCH SCRIPSIT A=DC17 F=0000000000000000 C=3DE2CG5GG7C338E2 6. The alignment tab problem is fixed by the following two patches: PATCH SCRIPSIT A=9CD8 F=FDBE1G C=C320DC PATCH SCRIPSIT A=DC20 F=0000000000000000 C=FDBE1SCAEB9CFE0D PATCH SCRIPSIT A=DC29 F=000000000000 C=CAEB9CC3DD9C 3 Microcomputer NEWS, April 1981 Radi Model II Ideas Kenneth Willoughby of Fairacres, NM sent us the following .fetter and program: "Dear Editor, "I am enclosing 2 software programs that may interest your readers. These are for the TRS-80 MODEL II. One is a cheap WORD-PROCESSOR by which I am writing this letter using the EDITOR functions to correct mistakes and so on. "Each instruction line could have 2 l h lines of instruction to fill out the logical record but this would goof up the automatic page and line count in the FORMS control when running the program and printing on the line printer (I have lineprinter II). To begin my letter, I use only the video until satisfied with the letter program. There it can be listed, deleted, and merged with the subject matter of previous letters in cannibal fashion. "The second program is a MODEL II video graphics program that I developed. It seems to teach the MODEL II graphics ability as well as being fun to play to test your skill. I was disappointed at (the) TRS-80 graphics book. It did not give me any inkling of the power built into the MODEL II system. I had to stumble through letting the powerful ERROR MESSAGES of MODEL II teach what to do next. This is what makes me love the MODEL II more than any computer that I have ever used, from the IBM 610 to the UNIVAC 1108 and CDC 6600. This second program is a simple shooting gallery or a radar search type problem . . . "PS. Why doesn't RADIO SHACK package and market more systems catering to helping handicaps conquer their mobility and communication barriers through electronic means? You have all the components in your RADIO SHACK catalog. Combine a com- puter, ultrasonic burglar detector, and speech synthesizer to help a newly blinded person learn room-object locations. Combine a computer, voice synthesizer, and VOXBOX to help a deaf person to speak over the phone as well as receive speech. Combine a computer with a telephone modem to help a paraplegic work out of his home minimizing his mobility problem which is what I am doing." Program 1 100 LPRINT 110 LPRIIMT"TRS~80 Microcomputer NEWS" 120 LPRINT n c/o Editor" 130 LPRINT"P*0*B0X 2910" 140 LPRINT"F0RT WORTH .TEXAS 76101" 150 LPRINT 550 *SYSTEM"F0RMS T !l Note: What Mr. Willoughby has done is to create a BASIC program, in which each line of the program is a line of text in his letter. By making each line fit the video display, he is assured that his letter will fit his LP II, and he knows in advance exactly how the letter will look, which allows him to make effective use of hyphenation. As he pointed out in his letter, BASIC'S editor is very powerful and should make editing this type of letter fairly easy Program 2 Here is Mr. Willoughby 's second program, with a couple of minor modifications which make it play faster and fit our print format: 10 PRINT n ---TARGET GAME FOR ONE PLAYER 20 REM: THIS TARGET GAME IB ONE PLAYER WHICH WILL HAVE 5 TARGETS (0) AND 30 REM: HAVE 10 SHOTS WITH ELEVATI0N= 0-20 & AZIMUTH= 0-60 CHOSEN EACH SHOT 40 REM: TARGETS (0) AND SHOTS (X) WILL BE DISPLAYED AS WELL AS SHOT COUNT 50 PRINT"LIST 10 TO 90 FOR INSTRUCTIONS" S0 SYSTEM'TAUSE" 100 CLSs RANDOM N(Z) THEN ) ) , CHR$( 159) ■The biggest name in little computers® 110 FOR Z- 2 TO 7 120 REM ROW 130 M(Z)=INT(RND<20)+,5) 140 REM COLUMN 150 N(Z)=INT(RND(S0)+ t 5)+10 160 REM TARGET DISPLAYED 170 PRINT@(M(Z) ,N(Z) ) f H 0" 180 NEXT Z 190 FOR J=0 TO 20 200 REM RIGHT VERTICAL 210 PRINT@( J #10) * CHR$(151) 220 NEXT J 230 FOR K= 10 TO 70 240 REM BOTTOM HORIZONTAL 250 PRINT@(20 >K> tCHR$(143) 260 NEXT K 270 FOR J=0 TO 20 280 REM LEFT VERTICAL 290 PRINT@( J >70> * CHR$(151) 300 NEXT J 310 C=0s D=0s R2-10 320 PRINT@(0»0) » "GUN SET?" 330 PRINT@(2 #0) »"ELEV?" 5R15 340 PRINT@(2 »0> t 5 350 INPUT n ELEM" 5R1 360 PRINT@(3#0> *"AZ?" 5R2-105 370 PRINT@(3 »0) * 5 380 INPUT'AZ" SR2 390 R2=R2+10 400 PRINTS (Rl »R2) »"X" 410 PRINT@(5»0) #"SH0T #"?C+1 420 FOR Z=2 TO 7 430 REM SHOT HIT 440 IF R1=M(Z) AND R2= PRINT@(M(Z) *N(2 450 NEXT Z 460 C=C+1 470 IF C=10 THEN 490 480 GOTO 330 490 PR I NT" AMMO GONE! " 500 END Mysterious Line Feed Mr. Ray B. Blessum of South Pasadena, CA sent us this letter concerning a problem with our Quick Printer II: 'The following program (throws) in an unwanted line feed: 1 LPRINT" 12345678901234567890123 456789012 2 LPRINT"See what I mean? RUN 12345678901234567890123456789012 See what I mean? "But this works OK: 1 LPRINT" 12345678901234567890123 456789012See? No unwanted line feed* RUN 12345678901234567890123458789012 See? No un wan ted line feed* "I thought you and your readers would like to know. "Or is there a better way There might be several 32 character lines in succession." Mr. Blessum is the victim of a "hidden" linefeed. Here is what happened (in the first example): 1. The printer correctly printed the first 32 characters in line 1. 2. As soon as the 32nd character was printed, the PRINTER issued an automatic carriage return since it was at the end of its line. 3. The computer then sent the carriage return which follows every LPRINT Statement. (Continued on Page 20) Microcomputer NEWS, April 1981 9 Radio/hack The biggest name in little computers Screen Dump, Revisited Here is a portion of a letter from L.M. Goddard of Exeter Col- lege in England: ". . . I noted with interest the screen dump routine (for Model II), written by Mr. Merrill E. Eastcott, Jr., which appeared in your September 1980 issue. "I enclose a variation of his program which I believe to be a little simpler and more convenient to use. It can be used at any time, whether in BASIC mode or DOS mode. It does not require to be MERGEd with a resident BASIC program . . ." SCREEN DUMP UTILITY FOR TANDY TRS80 MODEL II "The following machine language program provides a very convenient means of obtaining a screen dump to printer. It can be used when the machine is in either BASIC mode or DOS mode. 3. Enter the command line: F000 21 20 F0 F003 IS 4F F005 IE 00 F007 3E 0B F009 43 F00A 0E 00 F00C CF F00D 3E 13 F00F 0G 4F F0ii 0E 0D F013 CF F014 IC F015 75 F01S DS 18 F018 C2 07 F0 F01B C9 LOOP ORG LD LD LD LD LD LD RST LD LD LD RST INC LD SUB JP RET F000H HL >F020H D ,4FH E,00H A*0BH B ,E C 8 A B C 8 E A,E 18H 00H 13H 4FH 0DH t LOOP 1. The program is most easily entered using DEBUG, but can, of course, be entered in assembly code and assembled. If using DEBUG to enter the program, use DUMP to store it on disc with ST ART = F000 and END= F (3 1 B (Proqram name — SCRDMP/CMD). 2. Enter the following program in BASIC 100 SYSTEM "LOAD SCRDMP/CMD" 110 DEFUSR = &:HF000 120 X=USR<0) 130 END Save program with the name SCRDMP/BAS. 3. The utility can be used at any time, as follows: (i) BASICmode RUN"SCRDMF/B AS" (ENTER) (ii) DOS mode SCRDMP/CMD [ENTER) UNPATCH/BAS Mr. Ken Snapp, Jr. of Denver, Colorado sent us this information: "I have been using the Model II PATCH utility extensively and soon discovered the need for a method of reversing PATCHes without laboriously retyping the find and change strings. Conse- quently, I developed this short BASIC program which reads a BUILD-file containing PATCH commands and changes the F = sequence to C = and vice versa ..." Instructions for the use of UNPATCH/BAS: 1. Rather than enter PATCH commands directly from the keyboard, create a BUILD-file containing these commands. This procedure is required if you want to later reverse the PATCHes but is best in any case. 2. Type in the BASIC program from the listing and SAVE it (I use the filename UNPATCH/BAS). 1 Microcomputer NEWS, April 1981 BASIC UNPATCH/BAS-F:! (INTER) 4. The program will ask for the Filespec of the BUILD-file which contains the PATCHes to reverse, simply enter the desired filespec. i REM ##***#*********#**##******###*****####* 2 REM UNPATCH/BAS - REVERSES THE FIND AND CHANGE STRING 3 REM SEQUENCES IN A BUILD-FILE 4 REM CONTAINING PATCH COMMANDS 5 REM BY KEN SNAPP t JR. G REM DENVER* COLORADO 7 REM ###*****##**#**#*****#*****##****##*#*# 10 CLS: DEFINT R: DEFSTR A 20 DIM Al<4) 30 A1(0)="P": Al(l)="A"s A1(2)= M T": A 1 ( 3 ) = " C " : A 1 ( 4 ) = " H " 40 INPUT"Enter Filespec of BUILD-file containing PATCHes to Reverse "?AF 50 RL = 0s RN = 0: Ri=l: R2=0: R3 = S0 OPEhTD" #1 >AF,1 70 FIELD i t 1 AS CH$ S0 RE= LOF(l) 90 GOSUB 4000 100 IF RC=34 THEN R3=Rls R2 = 0: GOSUB 3000 110 IF RC=13 THEN R1=I: R2 = 0: GOTO 150 120 ON Rl GOSUB 1000* 2000 130 RL=RN 140 AL=CH$ 150 IF RN< RE THEN 90 160 CLOSE 1 170 INPUT"PATCH Reverse Complete* Restart it? (Y/N) " ? AA 180 IF AA="Y" THEN 40 190 END 1000 REM TEST FOR "PATCH" COMMAND 1010 IF CH$=A1(R2) THEN R2=RZ+1 ELSE R2=0 1020 IF R2=5 THEN Rl=2: R2=0 1030 RETURN 2000 REM TEST FOR FIND/CHANGE SEQUENCE 2010 IF CH*<> ,, = " THEN 20B0 2020 IF AL="F" THEN LSET CH$="C ,! : GOTO 2050 2030 IF ALO "C" THEN 20S0 2040 LSET CH$="F" 2050 PUT 1 t RL 20S0 RETURN 3000 REM BYPASS DATA ENCLOSED BY QUOTES 3010 GOSUB 4000 3020 IF RCO-13 AND RCO-34 THEN 3010 3030 R1=R3 3040 RETURN 4000 REM GET NEXT CHARACTER 4010 RN=RN+1 4020 GET 1 fRN 4030 IF CH$=" " THEN 4010 4040 RC=ASC(CH$) 4050 RETURN Color Computer Product Line Manager's News Before we get into the meat of the fun "stuff' this month, here are a few facts for the hungry mind . . . If you happen to be using the new Line Printer VII with your color computer and are playing Chess (26-3050), Checkers (26- 3055), or the new Backgammon (26-3059), be sure that the printer is turned off. It seems that the coding for the programs sends "garbage" across the serial port which the printer picks up as data. When the buffer is full, the printer prints 80 characters of "garbage." Nothing is hurt, just your nerves when you're in hot pursuit of the opponents Ffrig and suddenly the printer starts chat- tering at you. The next piece of news is the Square Root function in stan- dard Color BASIC (or should I say the lack of one). The RSC-4 catalog claimed a SQR function was available in standard Color BASIC, but it is only available in Extended Color BASIC. This being the case, here is a short subroutine you can use to figure square roots in your programs: A= your number B = square root (A) 10 B = A/3 20 B=*5*-(X2#Y2) ,a ,b XI and Yl are the X, Y coordinates for the start of the line and X2, Y2 are the end point of the line, "a" is either PSET if you want to draw the line using the foreground color (be able to see it once it is drawn) or PRESET (draw an invisible line) using the background color. The "b" is for those of you who want to get fancy. It can be B or BF. "B" will use the two X, Y coordinates as diagonal comers and create a box, while the "BF" will use the two X, Y coordinates as diagonal comers and create a box, then fill the box with the foreground color. Note: If XI and X2 are the same or if Yl and Y2 are the same then all you will get is a straight line with no box. (You can control the foreground — background colors by using the COLOR statement, but that is another article.) Again, start at line # 30 and begin to develop your "dream house." If you're having trouble, look at the program listing at the end of this article. There are a lot of program lines there, but if you stop between line 190 and 200, put in an endless loop like, 195 GOTO 195, you should get the idea. Please notice that I haven't used the U B" and "BF" functions in my program. Why don't you try it, since I don't want to spoil all the fun of programming in Extended Color BASIC. 5 CLS 10 PCLEAR 4 15 PM0DE 3tl 17 PCLS 2(3 SCREEN 1 ,i 30 LINE(0 ,185)-<255 ,185) ,PSET 40 LINE(50 ,135)-(200 ,135) ,PSET 50 LINE(5(3 ,135)-(50 ,85) ,PSET 60 LINE(150,135)-(150,85) ,PSET 70 LINE(200 ,135)-<200 ,105) ,PSET 80 LINE(50 ,85) -( 150 ,85) ,PSET 30 LINE( 150 ,105)-(200 ,105) , PSET 100 LINEC70 ,S5)-( 170 ,G5) , PSET 110 LINE(170,85)-C220,85) ,PSET 120 LINE<50,85)-(70,65) ,PSET 130 LINE( 150 ,85)~( 170,65) , PSET 140 LINE(150,105)-(170,85) ,PSET 150 LINE(200 ,105)-<220,85) ,PSET 160 LINEU70 ,G5)-( 190 ,82) ,PSET 170 LINE<220 ,B5)-<240 ,102) , PSET 175 LINEU90 ,82)-(190,85) ,PSET 160 LINE(240, 102)-<240, 127) , PSET (Continued on Page 12) Microcomputer NEWS, April 1981 \ \ Radie /haek @ — The biggest name in little computers® Color (From Page 11) 190 200 210 220 230 240 250 2B0 270 280 290 300 310 320 330 340 350 380 370 380 380 400 410 420 430 440 450 4B0 470 480 490 500 510 520 530 540 550 LINE(200*135)-<240*127) *PSET FOR X = S2 TO 77: LINE( 140 *)•<)-( 145 fX) * PSET: NEXT X FOR X = 62 TO 77: LINE( 145 *><)-( 148 *X-3) *PSET:NEXT L I NE ( 140. 82) -( 145*58) *PSET LINE-(148*58) *PSET LINE< 155 *135)-(155*115) *PSET LINE( 195* 135) -(195* 115) *PSET LINE* 155*1 15) -(195*1 15) *PSET FOR X=115 TO 135 STEP 5: LINE( 155 *}<)-< 185 *X) *PSET:NEXT X 1 23 : (170"*X) *PSET: (190*X) *PSET:NEXT X )-(17G*127) *PSET TO 70 STEP 4: + 100 *Y) *PSET: 150 TO 170 STEP 4: +50 *Y) *PSET: FOR LINE LINE LINE Y = 85 LINE Y Y=10 LINE Y = Y- LINE LINE LINE PSET LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE LINE X=122 TO <1B0*X)- (180*X)- (174*127 :FOR X=5 (X*Y)~(X 4: NEXT X 5: FOR X= (X*Y)-(X 4: NEXT X (85*135) ( 105 *135 (85 *H8) (103*128 (55*130) (55*130) (80*130) (55*118) ( 110*130 (110*130 (145*130 (110*118 (83 *100) (S3 *100) 100) 105) (80*100) (80*100) (85*100) (80 *105) ( 108*100 (108*100 (113*100 (108*105 -(95*118) * )-(105*118 -( 105 *118) *8) »(80*130) * -(55*118) * -(90*118) * -(80*118) * )-(145*130 )-(H0*118 )-( 145*118 )-(145*118 (87 (S3 -(87 -(83 -(87 -(87 -(85 -(80 -(85 -(85 *100) *105) *105) *105) *100) *105) *105) *105) )-(113*100 )-(108*105 )-(H3*105 )-( 113 *105 PSET ) *PSET *PSET PSET PSET PSET PSET ) *PSET ) *PSET ) *PSET ) *PSET PSET PSET PSET PSET PSET PSET PSET PSET ) *PSET ) *PSET ) *PSET ) *PSET LINE (128* 100) -(131 *100) ,PSET L I NE( 128* 100) -(128* 105) *PSET LINE( 131 *100)-(131 *105) *PSET LINE( 128*105) -(131 *105) *PSET LINE(B0 *1S5,~ LINE(95 *135)~ LINE(105*135) LINE(B5 *145)- LINE(30*150)~ LINE(0*115)~( LINE(240*115) GOTO 880 -(105*1 (20 *1B5 -(80*18 20*185) (255*18 (30 *150 -(85 *14 (105*14 (82*150 50*115) -(255*1 45) *PSET ) *PSET 5) *PSET PSET 5) *PSET ) *PSET 5) *PSET 5) *PSET ) *PSET *PSET: 15) *PSET 580 570 580 580 800 805 810 820 830 840 845 850 880 870 880 Lines 5-20 set up the computer to display graphics. lines 30- 1 90 outline the house and attached garage. Lines 200-230 draw the chimney lines 240-290 create the garage door with windows and handle. (I decided my garage will have a four-section door.) Lines 300-310 put shingles on the house and the garage, lines 320-350 give me a front door with a handle, lines 360-590 draw in the picture windows on the ground floor and the bedroom windows upstairs. Lines 600-670 create the sidewalk, driveway, and the horizon behind the house. Now, for the creative and fancy readers. Since lines 360-590 are drawing squares and rectangles, each using four program lines, let's let Extended BASIC do some of the work for us. Delete those lines (360-590) and add these instead: 380 LINE(55*118)-(80*130) *PSET*B 400 LINE( 110 *130)-( 145 *118) *PSET 440 LINE(S3*100)-(B7*105) *PSET *B 480 LINE(80 *100)- (85 *105) *PSET *B 520 LINE( 108 *100)-( 113 *105) *PSET 580 LINE( 128 *100)- ( 131 *105) *PSET *For the real fancy reader, add a "F" after the "B" in each of these lines to color the windows. In just 6 program lines we have accomplished what 24 pro- gram lines did in the original program. Now, how about a work- shop . . ., or a storage shed . . ., or another wing to the house or a three car garage .... or . . ., well enjoy LINE and Extended BASIC Til next month... *B *B .2 Microcomputer NEWS, April 1981 Radio /haek® ■The biggest name in little computers © Color Castle We recently received a letter from Mr, Ken Clause of Metuchen, NJ. The letter contained two parts, the first part was a modification to Dec. 1980's Christmas Tree program, and the sec- ond part was a rewrite of the Level I Castle Shot Program (Fire When Ready, Gridley; Page 212 of the Model I Level I manual). Here are portions of his letter: "The December, 1980 issue of "Microcomputer News" listed a program (page 14) "A Tree for your Color Computer." This pro- gram did not run on my color computer or the unit in my local computer center. "I have re-written lines 10 to 1 10 to correct the problem, and modified line 470." We re-entered the tree program here, using the listing from the Dec. newsletter, and had no problems with it. We suspect that the program ran correctly, and Mr. Clause decided that "there must be some mistake." Which only goes to show that each of us has slightly different tastes in programs. Here are the "corrected" lines which Mr. Clause provided (They work very well): 5 CLS 10 F0 20 PR 25 F0 30 NE 40 F0 50 PR 55 F0 60 NE 70 F0 80 PR 85 F0 80 NE "00 F 10 N R INT© R T = XT X R X = INT© R T = XT X R X = INT© R T = XT X OR X EXT 3 TO 479 STEP 86 X* "MERRY CHRISTMAS FROM US ALL! 1 TO 300s NEXT T 35 TO 510 STEP 9S X *" HAPPY NEW YEAR TO 1 TO 300: NEXT T 75 TO 460 STEP 86 X*"FR0M TRS-80" 1 TO 300: NEXT T =1 TO 1000 i'OU ALL! Lines 120 to 460 were unchanged. 470 GOTO 470 Here is Mr. Clause's version of "Fire When Ready, Gridley" for the 4K Color BASIC computer: A$ 5 CLS(0) 10 INPUT"ENTER YOUR INITIALS"; 20 CLSC0) 30 2 [ = 42 40 FOR Y=12 TO 31 50 FOR X=2 TO S3 60 SET(X >Y *2) 70 NEXT X 80 IF Y<14 THEN Z = Z + 2 90 NEXT Y 100 FOR X=42 TO S3 STEP 6 110 SET(X*11 *3> 120 SEKX+1 *11 *3) 130 NEXT X 140 Q = 150 PRINT© 280 *A$ " 'S" 5 160 PRINT© 312 * "CASTLE" 5 170 FOR Y=1S TO 19 180 SET(S3 *Y *2> 190 NEXT Y 200 FOR Y=1B TO 19 210 5ET(62*Y*2) 220 NEXT Y 230 FOR X=4S TO 49 240 SET(X*9 *7) 250 SET(X*10*7> '.60 NEXT X 270 FOR X=40 TO 54 280 SET(X*7*7) 290 SET(X*8*7) 300 NEXT X 310 1 FOR Z=l TO 2 320 FOR X=2 TO 12 330 FOR Y=26 TO 29 340 SET(X *Y *4) 350 NEXT Y 360 NEXT X 370 FOR X=2 TO 12 STEP 2 380 RESET (X. 27) 390 NEXT X 400 FOR X-7 TO 8 410 RESET(X*29) 420 NEXT X 430 FOR X=l TO 100: NEXT X 440 RESET<40*7) 450 RESET<40*8) 460 RESET(41 *7) 470 RESET(41 *8) 480 SET(54*7 *7> 490 SET(54 *8>7) 500 SET<55*7*7) 510 SET<55*8*7) 520 FOR X=l TO 200 s NEXT X 530 PRINT© 87*" B000M! ! ! " 5 540 RESET(54 *7) 550 RESET(54*8) 560 RESET (55*7) 570 RESET<55*8) 580 SET<40*7*7) 590 SET<40*8 *7> 600 SET(41 *7 *7> 810 SETU1 *8*7) 620 SOUND 175 »1 630 FOR X=38 TO 2 STEP -1 640 P=X-41 650 Y=P*P/83+7 660 SET(X*Y *8) 670 SET(X-1 *Y*8) 680 RESEKX+1 *Q) 690 RESET 900 NEXT Z 910 GOTO 5 Microcomputer NEWS, April 1981 13 Pocket Computer Product Line Manager's News This month, rather than telling you about one of our Pocket Computer programs, I would like to share with you the programs which we have received from readers over the last several weeks: Programmable Timer Here is part of a letter from Larry C. Crump of Mineral Wells, Tx.: ". . .This is a program to turn the (pocket) computer into a programmable delay timer. I use it as a reminder when I have to go to a meeting later in the day. A time delay from 1 to 999 min- utes is entered and at the end of this period the beeper goes off and "announces" the number of minutes chosen have elapsed. The timer has less than 3 seconds error per hour on my com- puter. I am interested to know if other computers will run the same speed close enough with varying battery condition, etc. Programmable Timer 10 PRINT" PROGRAMMABLE TIMER ii 20 PAUSE" INPUT DELAY IN MINUTES" 30 PAUSE" THEN HIT ENTER." 40 INPUT T 50 BEEP 1 G0 C = 0: M = 70 IF T<1 THEN 170 80 IF T>999 THEN 180 90 FOR A = i to as 100 PAUSE 11 li 110 NEXT A 120 C = C+1 : M = M+1 130 IF M = 4 THEN 200 140 IF C< T THEN 90 150 BEEP 10 1(30 IF T = 1 PRINT" ONE MINUTE IS U 170 PRINT Tt"MINS* ARE UP ♦ " 180 PRINT "MAXIMUM DELA V ' 999 1INS* 190 GOTO 10 200 M = 0: PAUSE " " 210 GOTO 140 220 END UP* 'The angular symbol blinks to show the program is running. The clock is based on the fact that about 49 FOR-NEXT loops run per minute. This isn't accurate enough so a "fudge" factor is inserted every time M = 4 by adding another .85 second pause in line 200. line 70 is included to negate the fact that or negative minutes look like 1 or positive minutes. Line 80 limits the maxi- mum time to a reasonable battery time a nd machine limits. Two hits (3 for 1 minute input) of the (ENTER) key after the program runs brings it back ready to enter another time delay I hope this program will time out right on all pocket computers. Thanks for a wonderful product that is a true innovation for the future." TRS-80 Pocket Computer Telephone Book Mr. Randy Bonin of Port Arthur, TX sent this program for the Pocket Computer: \ ^ Microcomputer NEWS, April 1981 "I wrote the following program to keep track of names and telephone numbers I use regularly It will hold sixty-six entries, lines 30-50 (first loop) search for the name, if found in files, pro- gram exits loop and name/number is printed in line 80. If not in file, a message is printed in line 60. New info is input in line 100. Lines 110-150 (second loop) will check for a name duplication and also check for the first open memory location. If no memory is left, the message in line 160 will be displayed. If a memory location is open the program will then ask for the number in line 190, then the message in line 220 is displayed. "The program will start in "DEF" mode by pressing (SHFT) CD- New data entry is made by pressing (SHFT) (N). "Program will hold 66 names and numbers. Hope you enjoy it. "Note: Name file will only hold the first seven characters." 010 "L" REM TELEPHONE LOG 1-6-81 RANDY BONIN 020 I, "ENTER NAME ,l 5 A$ 030 F. B = 27 TO 159 STEP 2 040 IF A$=A$65535GOTO10 IFD<0GOTO10 U=INT(D/256) sT=D-25B*U W=IIMT(U/16) :X=U-W*1S Z=INT(T/1B) :Y=T~Z*IB BEEP1:G0SUBA+W:W*=V* BEEPlsGOSUBA+X BEEPlsGOSUBA+Z BEEPlsGOSUBA+Y G0SUB997 GOTO 10 RETURN RETURN RETURN RETURN RETURN RETURN RETURN RETURN RETURN RETURN RETURN RETURN RETURN RETURN RETURN RETURN 300:PAUSE"ENTER ;D:A=100sQ=0 X$ = V$ Y$=0$: IFQ=1GOTO440 0"! 1"! r? " i 3" I 4" i 5" ! B ,f ! y$="8" i M$="9' 1 i V$="A" i M$="B" i U$="C" i y$="D" i 0$ = "E" ; m H m . A= DIGITS" sPAUSE " ONE FORN=27TO30sINPUTA$(N M=30:D=0:FORN=27TO30: D = D + A(N + 4)*1B- (M-N) :N N$ = A$(27) :X$=A$<28> sZ U = A(31)*lB + A(-32) :T = A( GOSUB 997: GOTO 200 IFA$(N) = ,, 0"LETA(N + 4) = IFA$(N) = M r'LETA(N"H4) = IFA$(N)= M 2"LETA(N+4)= "3"LETA(N+4)= M 4"LETA(N+4)= "5 FOUR HEX AT A TIME" ) sNEXTN GOSUBAsBEEPl: EXTN $=A$(29) :Y$=A$<30) 33)*1G+A(34) 0:RETURN IFA$(N)= IFA$(N)= IFA$(N)= IFA$(N)= IFA$(N)= IFA$(N)= IFA$(N)= IFA$(N)= IFA$(N)= IFA$(N)= IFA$(N)= LETA(N+4)= n G"LETA(NH-4) = "7"LETA(N+4)= n 8"LETA(N+4)= l, 9"LETA(N + 4) = "A"LETA(N+4)= ,, B"LETA(N + 4) = !, C"LETA(N + 4) = "D"LETA255GOTO410 414 IFU<0GOTO410 420 INPUT"LSB?" tT 422 IFT>255GOTO420 424 IFT<0GOTO420 430 D=U*256+T:GOTO30 440 G0SUB997:G0T0 400 997 print" " ;n$ ;x$?z$;y$;" h ;u; m m ? t$ h " ;d 998 IFD>327S7LETP=-1*(S553S-D) : PRINT"POKE = " iP 999 RETURN Simple Planetary Here is a letter from Alan Sheidler of Moline, Illinois: Several months ago I purchased a TRS-80 Pocket Computer. I have found the pocket computer to be a valuable design aid in my work as an engineer for a large machinery company. The pocket computer is a very versatile machine, well suited as a tool for the development of the initial concept of a design. EXAMPLE: Before detailed work can begin on the design of a transmission, a great many gear train proposals must be devel- oped, analyzed, and of course eliminated. Only one proposal will ultimately be adopted. For any particular transmission there are thousands of gear train configurations which are possible. Many parameters are used to judge the virtues of each proposal, but the most important of these is whether or not the available gear ratios match what is desired. The calculation of gear ratios can be very difficult for some types of complicated gear trains. One type of gear train called a "planetary" gear train is a good example of this. I have written a short program for calculating the gear ratios obtainable with one type of planetary gear train called a "simple" planetary . . . PROGRAM 10 20 30 40 50 B0 70 80 90 100 110 120 130 140 150 1B0 170 180 190 INPUT INPUT INPUT INPUT IF X* = IF X* = IF X$ = BEEP 2 5X$:G0T0 IF Y$="S" IF Y$= " BEEP 2s !Y$:G0T0 IF Y$ = " IF Y$= " BEEP 2s ?Y$:G0T0 IF Y$= " IF Y$= " BEEP 2: ?Y$sG0T0 PRINT "G GOTO 10 OF SUN OF RIN PUT GR AT IS " THEN " THEN " THEN PUT H R 50 G = R/S C " G = INPUT 90 S" G = R" G = INPUT 120 R" G = p ii r = INPUT 150 EAR RA GEAR TEETH " 5S G GEAR TEETH " 5R OUNDED ELEMENT " 5X$ INPUT ELEMENT " ?Y$ 90 120 150 EENTER GRNDED ELEMENT " +1:G0T0 180 1/(R/S+1) sGOTO 180 "REENTER INPUT ELEMENT " -R/S:G0T0 180 -S/RsGOTO 180 "REENTER INPUT ELEMENT " S/R+1-G0T0 180 1/(S/R+1) sGOTO 180 "REENTER INPUT ELEMENT " TIG="» USING"###* #=»####" ;g //// R c ~ P S Microcomputer NEWS, April 1981 \ 5 There have been a number of prob- lems related to printer code response involving several Model I/III software packages. I will try to explain here the sources of the problems, the resulting errors and possible corrective actions which might be taken. The printer drivers which are a part of Model I ROM were tailored to fit the only printer available at the time (LP I), and the Model III drivers were fashioned after the Model I drivers to maintain com- patabUity and assure support for Model I products. That first printer was a very dumb printer and had a rather unusual response to certain codes. Because of this, the ROM printer driver intercepts cer- tain codes normally passed on to the printer and substitutes others designed to achieve the desired response. The early Radio Shack printer did not have a built-in "top of form" (advance to next page) function. Therefore, the only way to advance to the top of the next page was to issue the proper number of line feed commands to the printer. To date, Radio Shack software does not sup- port any automatic TOF action by a printer. In order to achieve proper response, both the TOP OF FORM command, CHR$U2) and the vertical tab CHR$(11) are intercepted. The computer compares the number of lines already printed on the current page with the maximum number of lines to print on that page (plus one), and a suitable number of linefeeds are sent instead of the CHR$(11) or CHR$(12). In both the Model I and the Model III, the maximum lines per page is set to 67 at power-up. Note that this value is the maximum number of lines for 1 1 inch paper (66) PLUS one. All R/S printers, upon receipt of a Carriage Return (CR or CHR$(13)), not only issue a return to the beginning of the current line but also advance to a NEW LINE (LF). In addition, early models (LP I, II, IV, and some versions of LP III (26- 1156A)) ignore any CR issued if there is no text in the print buffer. Thus, the printer ignores all but the first in an unbroken series of CR codes. For this reason, those confangled early printers refuse to respond to a null string, (i.e. — just LPRINT). Since the printer already issues a LF when a CR is received it seems to assume that in a string of line feeds (issued to reach Top of Form for instance) the last LF is a mistake and ignores it. Peripherals Product Line Manager's News 1 © Microcomputer NEWS, April 1981 Actually, what really occurs is that no action is taken upon receipt of the line ter- minator (The last CHR$(13) in a string of CHR$(13)s). The code for "line feed" is decimal 10 (CHR$(10)). This is supposed to cause the printer to advance one line without changing the position of the carriage. However, the BASIC Interpreter intercepts the "10" (LF) in the expression CHR$(10) and REPLACES IT with a CR (CHR$(13)). (Some RS printers issue a CR as well as a LF when they receive a 10.) IN ADDI- TION, the "NULL" code CHR$(0) is sim- ply ignored; it is not passed to the printer at all. This should tell you that if you have a printer which happens to respond "cor- rectly" to the CHR$( 1.0), or reacts to all CR codes it receives, you are in trouble! Clear as mud? There's more to come! Our first printers only had seven data lines active; the eighth bit (Most Signifi- cant Bit) was simply not connected. In order to slip a code " 10" past the watchful eye of the BASIC interpreter, some intrepid programmer discovered that CHR$(138) looked like a code "10" to the printer because the missing eighth bit was the difference between the binary forms of 10 and 138. This was great until a printer came along which used that eighth bit for some- thing. Real trouble! To correct this, we have undertaken the task of establishing codes which can be implemented on afl our new printers. Our new standards, now being finalized, reflect a straightfor- ward approach (more about these in future issues). This means, however, that software written for the earlier machines might not print the way they were designed. ENTER LPC/CMD LPC is a system (machine language) program which modifies the ROM printer driver in Model I/III. It is designed to allow the system to emulate the response of the first generation printers on a printer hav- ing the new revised code response. In other words, LPC throws away all but one CR in a series of carriage returns (ignores LPRINT statements which do not have any text) and converts 138's to 10's. LPC might be necessary with some software when using these current ("new") printers and/or any future RADIO SHACK printer product: line Printer III (26- 1 1 56) line Printer V (26-1165) VI (26-1166) VII (26-1167) All Daisy Wheel Printers When do you need LPC? Well, if you run your application and you keep adding a line every time you do a Top of Form then you need it (you are having "Top of Form trouble"); or if you lose line feeds (you are having problems with CHR$(138)). At this writing to say exactly which Model I/III programs need the driver is like trying to hit a moving target. Many times it has been possible to fix the problem before release of a new version. In many cases, both "fixed" and original versions exist in the field and there may not be an easy way to know which is which. This list of Model I/III software which requires LPC/CMD is current at this time. It might (will!) change: 264504 Level II Payroll 26- 1 506 Cassette Portfolio 26-1507 Standard and Poor's STOCKPAK® 26-1552 General Ledger 26-1553 Inventory Control 26-1556 Disk Payroll 26-1557 Concrete Take-Off 26-1558 Mailing List 264559 Manufacturing Inventory Control 264560 Fixed Asset Accounting 26-1562 Profile 26-1571 Real Estate Vol. 1 26-1572 RealEstateVol.il. 26-1573 Real Estate Vol. Ill 26-1574 Real Estate Vol. IV 26-1603 Budget Management If you have these programs, and you are having the problems we are describ- ing, use LPC/CMD. If the problems do not appear, LPC is not needed. MOD I to MOD III conversions which you do yourself may also need LPC. These conversions are those which you might do to move an existing program (yours or ours) from Mod I to Mod III. LPC is a very shy beast. Once loaded (usually by an AUTO command on your application disk) it burrows into the sys- tem and pulls the sand over it's head and disappears. That is, when you load LPC, it checks the computer, moves itself to just below the top of memory, and then resets the Top of Memory pointers in the (Continued on Page 17) Radio ihaeU The biggest name in little computers (TM) Peripherals (From Page 16) odel I to just below itself. When this pro- cess is complete, the computer does not know that the program is there! Since the program "disappears," if you attempt to load a second copy of LPC because you forgot the first copy was there, LPC will load a second copy, just below the first one (remember, LPC changed the Top of Memory pointers)! Do this often enough and you will run out of memory LPC/CMD for Model I Disk systems is available free from your RADIO SHACK dealer. Order number 700-2007. For Model III Disk users, LPC/CMD is included with TRSDOS 1.2 and will be included with all future Model III TRSDOS releases. To help you avoid the problems we have been discussing in your own pro- grams, here are a few tips from our appli- cation programmers which should elimi- nate the need for LPC: 1. At the beginning of the program insert the following statement to preset the line count: POKE IG425»1 2. To do procedure: a TOF, follow this LPRINT 1B425 t CHR$(12) ? :P0KE 1 (Please note that the semi-colon (;) jllowing the CHR$(12) is extremely important) 3. Do NOT use CHR$U38). If you have used CHR$(138), change it to CHR$(32). CHR$(32) is the code for a blank or space. (If you know that your program will be used ONLY with a "new" printer, you can use LPRINT by itself.) These steps will give you a CR/LF. There is currently no way to send a character 10 to an eight bit printer from BASIC. Our application programmers assure us that these procedures will work with both Models I and III, all ROM ver- sions and all "known" printers. There are a few more loose ends which need to be addressed. A glance at some Radio Shack printer manuals will reveal an attempt to provide CR/LF response to CHR$(138). This can of worms should not have been opened and such response is no longer supported. Because the operating system in MODEL II is in RAM it has been a little eas- ier to address the code response prob- lems there. Normally the Model II BASIC Interpreter completely ignores the CHR$(10). Also, TRSDOS 2.0 has a trans- parent mode to allow all codes written in JASIC to reach the printer (remember Model II BASIC ignores code 10, so you cannot send a 10 to the printer, even with the transparent mode on). A similar "transparent" driver is being prepared for Model I/III so that the full capabilities of our new graphic printers can be utilized. More about that in a future article. Is it all clear now? Let me stir it all up again. There is a way, in the case of sev- eral R/S printers, to eliminate some of these problems without changing soft- ware or installing drivers. Some "new" R/S printers are designed so that they can easily be changed by your service repre- sentative. These changes cause the printer hardware to emulate the early machines; these newer printers can be set to allow or dissallow the automatic line feed as well as set or reset the "buffer empty response — throw away a LF" syn- drome. The automatic New Line is still a necessary response for Radio Shack soft- ware. The second option is of value only in cases where only the older software are going to be used. If you use it, newer soft- ware could have problems. To help make things a little clearer, look at the chart, which shows how our different printers react, and whether their response is changeable. Note that if the printer response is changeable, the chart shows the way the printer is shipped from the warehouse. These changes are documented in our Service Manuals. You should let the R/S service center adjust the machine as your warranties are voided when the machine is opened by unauthorized per- sonnel. The ability to make these changes will be a feature of all future Radio Shack Dot Matrix printers as long as there is a perceived need. I'll grant you the value of the ability to defeat the automatic LF but pray for the day we can wave goodby to that "buffer empty" ordeal. I know that some of this may be con- fusing. It has been giving the folks here in Ft. Worth a fine time, but we "bit the bul- let" and are going with a standard for future products. A little confusion and inconvenience now will buy us a proper standard to work with in the future. Next month I will have juicy details of our new Plug N Power Controller. And in an upcoming issue (maybe next month) I hope to feature a chart outlining the code response of all our printers, our new printer code response standards, as well as more complete information on the Model I, II, and III printer drivers. VieW 7th (From Page 2) Since the heart of the system is a general purpose office computer, it can also per- form important office functions. The Bucks will be utilizing the system in such areas as season ticketholder mailing list, and word processing while another club will be utilizing it for general ledger and payroll. The Sport Stats SS100 Basketball Scoring System took two years to develop working with several NBA teams. Sport Stats has just completed six months of extensive field testing of the system with the help of the Milwaukee Bucks and is now offering the SS100 for sale to NBA, college and high school teams. The "Sport Stats SS100 Basketball Scoring System" has been used at each of the Bucks home games this season. Two other NBA teams, the Golden State Warriors and the Phoenix Suns, also have the system installed in their arenas. Even- tually, it is hoped that computer stats will be universally accepted on a league-wide basis, helping the NBA step into the com- puter age. If any of you know of other applica- tions that would be of interest to our read- ers please send them in. I would like to hear more about the man who has a multi-thousand mailing list on a Model I — on cassettes. Until next month. mm Printer Code Response Chart Option 1 Option 2 If buffer empty Changeable ? CHR$(13) CHR$(13) CR All codes is CR/LF CRonly ignored executed LP I X X No LP II X X No Early LP III X X No Later LP IIIA X X Yes LP IV X X No LPV X X Yes LP VI X X Yes LP VII X X No WP50 X X No DWII X X No Microcomputer NEWS, April 1981 \ "J Education Educational Products News RADIO SHACK: A COMMITMENT TO EDUCATION We at Radio Shack believe that along with the development of a practically priced microcomputer, there exists an attendant obligation to make the system and its potential available to the educational community. To meet this obligation, Radio Shack has undertaken an extensive development effort to produce instructionally sound, effective, and properly validated microcomputer-based educa- tional materials for use in the classroom. COURSEWARE What is courseware? It is a special kind of computer program designed to teach. Any computer or microcomputer is useless without a program — a special set of instructions written in a com- puter language — that tefls the computer how to solve a problem, such as calculating a payroll, alphabetizing a list of names, or printing mailing labels. For an instructional application, a com- puter program must incorporate an additional level of design defining the scope and sequence of the materials to be taught. It must implement some acceptable instructional strategy Special courseware such as this is expensive and difficult to develop, and has been a limiting factor in applications of micro- computers in schools. Radio Shack is addressing the problem of courseware. We have involved the experts — the teachers and curriculum developers in the schools — in designing and field testing our new courseware products. Products such as the Radio Shack K-8 Math Program represent a growing commitment to courseware by Radio Shack. Our courseware products are divided into three categories: Computer Assisted Instruction, Educational Management Sys- tems, and the Computer Education Series. The following paragraphs describe some of these new materials. COMPUTER ASSISTED INSTRUCTION Computer Assisted Instruction (CAI) is based on the use of the computer as a medium of instruction — as a means of assist- ing the teacher in teaching subjects such as reading, mathematics, language arts, physics, and chemistry. The Education Division of Radio Shack has developed and made available a variety of CAI materials, and many more are under development. All of the programs described below require a minimum configuration of a 16K TRS-80 Model I (with Level II BASIC), or a 16K TRS-80 Model III (with Model III BASIC), unless otherwise noted. Each program includes a teacher's manual containing complete instructions. For more information on these programs, see your local Radio Shack store or Computer Center. AlphaKey^is an alphabet and keyboard familiarization pro- gram for children four to six years old. Parts one and two can teach children to discriminate capital letters and to associate capi- tal and lower-case letters. The letters are presented in sequence so the child becomes familiar with the order of the alphabet. When a letter is displayed on the screen, the child presses the key that matches that letter. Part three gives the child practice typing the letters of the alphabet in order with no hints. A report is given after each session. 26-1718 Suggested Retail Price: $29.95. Radio Shack's K-8 Math Program, Volume One, is designed to be used as a supplement to regular classroom instruction from kindergarten through eighth grade. Part One of this program is a series of six computer programs containing skill building exercises and a test mode in numeration, addition, and subtraction con- cepts for use in grades K through 3. Part Two contains skill build- ing exerdses, a test mode, and a placement mode for addition, subtraction, multiplication, and division, appropriate for use in grades 1 through 8. Its features include automatic promotion and demotion, appropriate reinforcement messages, a self-pacing feature, a comprehensive reporting function, and more. 26-1715 Suggested Retail Price: $199.00. The K-8 Math Program with Student Management, Volume One, consists of the original Radio Shack K-8 Math Program com- bined with a student management capability. This management system performs three main functions: • Maintains a complete ongoing record of all lessons and tests taken by each student. • Automatically keeps track of lesson promotions and demotions, sending the student to the correct lesson each time he/sh begins a session. • Allows the teacher to review and print out student reports. This set of programs requires a minimum configuration of a 32K TRS-80 Model I Disk System (with Level II BASIC) or a 32K TRS-80 Model III Disk System (with Model III BASIC). 26-1725 Suggested Retail Price: $ 199.00 Radio Shack's K-8 Math Worksheet Generator prints work- sheets and answer sheets for exercises in addition, subtraction, multiplication, and division, using selected problem sequences from K-8 Math. The teacher can choose the subject, lesson num- ber, and number of problems from each lesson. The worksheets can be identical, or the teacher can choose the number of different worksheets to be printed on the same level of difficulty The min- imum configuration required for this program is a 32K TRS-80 Model I (with Level II BASIC) or Model III (with Model III BASIC), and any Radio Shack line Printer. 26-2162 Suggested Retail Price: $89.95. Color Math is a self-paced drill and practice program in addition, subtraction, multiplication, and division for the TRS-80 Color Computer. It contains skill building exercises, a test mode, and a placement mode for each of these four programs. Intended for home use, Radio Shack's Color Math can provide hours of challenge in basic math concepts for students in grades K-8. The minimum hardware requirement for this program is a 4K TRS-80 Color Computer, Tape Recorder, and a color monitor or television. Available May, 1981. 26-3201 Suggested Retail Price: $39.95 The Essential Math Program, Volume One, is a self-paced drill and practice program designed to reinforce those math con- cepts introduced by the classroom teacher. It is a series of eight computer programs containing problems in addition, subtraction multiplication, division, and number concepts for grades seven through twelve. It features skill building lessons, a placement (Continued on Page 19) 1 3 Microcomputer NEWS, April 1981 Rac 'The biggest name In little computers' © EdUCatiOn (From Page 1 8) mode, optional promotion and demotion, reinforcement mes- sages, a comprehensive reporting function, and more. 26-1716 Suggested Retail Price: $ 199.00. Radio Shack's Euclid Geometry Tutor program is designed to reinforce basic geometry concepts introduced by the teacher. It allows students to practice constructing proofs using nine basic postulates of Euclidean Geometry. Four modes of operation make it possible for students to work at their own pace and to be chal- lenged according to individual ability. The teacher's manual con- tains complete instructions, plus a Selected Exercise section that gives students an opportunity for drill and practice in a wide vari- ety of problems. 26-1724 Suggested Retail Price: $29.95. Advanced Graphics is a secondary math program that allows students to study equations in the form y = fix) and r = fi0), or x = fiT) and y = fiT). The equations can be changed for a wide variety of applications. The Selected Investigations section of the teacher's manual gives extensive practice in problem solving. 26- 1714 Suggested Retail Price: $29.95. Vector Addition is a math and physics program for use at the secondary level. The student gives the computer the coordi- nates of the vectors, and the computer graphs them using either the tip-to-tail or common origin method. An edit feature allows students to add to the list of vectors or to change the vector com- ponents. The problem section of the manual covers seven phys- ics topics which use vectors. 26-1720 Suggested Retail Price: $29.95. Interpreting Graphs in Physics is a secondary math and physics program that allows students to solve problems in kine- matics using position vs. time and velocity vs. time simulations. A graph of the data is shown on the video display, and the program generates questions about the graph for drill and practice. Helpful hints are provided. At the end of each session, a student report is displayed. 26-1721 Suggested Retail Price: $29.95. Graphical Analysis of Experimental Data is a secondary math and physics program that allows students to analyze data using graphs. After the student types in data pairs, the program computes the line of best fit and graphs the data on a Cartesian graph. It also predicts the value of the dependent variable based on the values of the independent variable. A "stopwatch" timer feature for timing experiments is included. 26-1722 Suggested Retail Price: $29.95. An Investigation in Integral Calculus is a secondary math program that graphs and computes areas bounded by any func- tion Y = fiX) and the X-axis. The student supplies the function, the end points, and the number of intervals. Available Summer, 1981. 26-2600 Suggested Retail Price: $29.95. EDUCATIONAL MANAGEMENT SYSTEMS Another group of products made available by the Education Division comes under the heading Educational Management Systems. Many of these programs are authoring systems which allow teachers to create their own computer assisted instruction mate- rials. Also included will be programs which assist teachers and administrators with clerical and record-keeping tasks. Radio Shack's Quick Quiz allows teachers to create, store, administer, and print out multiple-choice exercises and tests using a TRS-80 microcomputer. A teacher can type up to forty questions with up to four answer choices per question into the computer and store them on a disk file. The program will then allow the teacher to administer the exercise or test at the computer to a maximum of fifty students and to store each student's score on a disk file. The teacher can also review the test results at any time. This program requires a 32K TRS-80 Model I or Model III disk system. 26-1728 Suggested Retail Price: $29.95. TRS-80 PILOT PLUS is a command-oriented author lan- guage that allows the teacher to create computer assisted instruc- tion materials. It is based on the PILOT computer language, but has extended capabilities for graphics generation and student file handling for daily student sessions. The manual includes a refer- ence section, step-by-step instructions in non-technical language, a sample lesson section, and more. Available May, 1981. 26-2205 Suggested Retail Price: $49.95. TRS-80/AUTHOR I is a screen-oriented authoring system that allows teachers with no previous computer experience to create sophisticated computer assisted instruction materials. It features full-screen editing and use of graphics, including the special Model III characters. The teacher can provide hints and a glossary to help the students when needed. Also, the teacher can design the les- son so that each student is shown appropriate material based on his or her performance. A student management module allows teachers to enroll students in lessons using assigned passwords. While students are working with the lessons, the program keeps track of overall and partial scores and response times. Special space compression provides efficient storage of lessons on a disk- ette. TRS-80/AUTHOR I requires a 32K Model I or Model III disk system. Available Summer, 1981. 26-1727 Suggested Retail Price: $150.00. COMPUTER EDUCATION SERIES Radio Shack's Education Division also produces materials which teach about the computer itself. The Computer Education Series is designed to be used at the secondary and college levels. Each set of materials in this series includes a teacher's manual, 25 student workbooks, and a set of overhead projector transparen- cies. (Additional workbooks are available separately.) Designed and thoroughly field-tested in schools, this series can be used by all teachers, regardless of their knowledge of microcomputers and programming. Each lesson in the series has five distinct parts: • The OVERVIEW is read to the students at the beginning of the class session to provide a general orientation on the topics to be covered. • The OBJECTIVES function as a contract with the learners, iden- tifying the skills they will learn if they do their part. • The NOTE-TAKING GUIDE keeps the learner's focus on the important aspects of the lesson. As the material is presented by the teacher, the students complete the guide in the Student Workbooks and then have a set of notes for review. • The QUICK QUIZ allows the students to assess their under- standing of each lesson. • The ACTIVITY allows the learners to apply the concepts and techniques in each lesson through a "hands-on" experience with the computer. Volumes in the Computer Education Series which are cur- rently available include: PART 1: INTRODUCTION TO BASIC— an introduction to computer programming using the TRS-80 and the BASIC language. 26-2150 Suggested Retail Price: $159.00. PART 2: BASIC PROGRAMMING — introduces more advanced elements of BASIC including editing, arrays, error mes- sages, memory management, string manipulation, and more. 26-2152 Suggested Retail Price: $199.00. PART 3: ADVANCED BASIC— introduces the INKEY$ state- ment, the ASCII character set, action graphics, cassette data files, mathematical and trigonometric functions, multi-dimensional arrays, and more. Available late Spring, 1981. 26-2154 Suggested Retail Price: $199.00. Additional volumes in this series will be available soon. We are committed to supporting educational uses of the TRS-80. Look for a growing list of educationally sound course- ware from Radio Shack. Microcomputer NEWS, April 1981 JQ Radio /hack MICROCOMPUTER NEWS P.O. BOX 2910 FORT WORTH, TX 76101 ADDRESS CHANGE □ Remove from List □ Change as shown Please detach address label and mail to address shown above. IF UNDELIVERABLE DO NOT RETURN Elec Marketing (FromPagen to receive and display the information 24 hours a day. The Professional Farmers of America's version of the Radio Shack VIDEOTEX ter- minal contains 16K of memory that allows up to 32 screens of information to be stored for instant user recall and anal- ysis. Phillips went on to say, "The Instant Update program is not a test but actually the first commercial application of this type and the largest program of its kind in the United States to date." Radio Shack's TRS-80 Model II com- puter was chosen as the connecting link between the central data base and the information user. By operating in a Store/ Forward mode the TRS-80 Model II links and dispenses agricultural marketing information in the central data base to the individual TRS-80 VIDEOTEX terminals at the subscriber's home or office. The use of TRS-80 Model II was a key element in the overall cost effectiveness of this system. The TRS-80 VIDEOTEX terminal has the ability to access other data bases mak- ing it more flexible to the user. Both Radio Shack and the agribusiness community are confident that the daily transmissions of Instant Update which began March 2, 1981 will formally usher in a new era of home/office information retrieval. Information retrieval technology has been the subject of many small tests and trials throughout the United States. The most notable being the Green Thumb Project in Kentucky in which Radio Shack participated by designing the terminal used in the ongoing 200 farmer test. NOt6S (From Page 1 ) 300 B0X=2s GOSUB 3G0 301 A$= LEFT$(N0$>4) 302 B$= MID$(N0$>5 »4) 303 C$= MID$(N0$*9 »4) 304 D$= MID*(IM0$#I3f4) 305 E$= MID*(N0$*I7*4) 1 5 b$; " " " 5 E$ 306 PRINT A$? " C$5 " "5 D$i 610 NEXT J 611 IF LEN(N0$)=Z OR LEN(N0$)=6 OR LEN(NO$)=10 OR LEN(N0*)=14 THEN N0*- »+ no$ 612 IF LEN(N0$)=3 OR LEN(N0$)=7 OR LEN(N0$)=11 OR LEN(N0$)=15 THEN N0$= " " + NO* 613 IF LEN(N0*)=5 OR LEN(N0*)=9 OR LEN(N0*)=13 OR LEN(N0*)=17 THEN N0*= "+ NO* Mr. Gene K. Lynch of Boulder, MT pointed out an error in the Roman Numeral Conversion Program (Jan. 1981). In line 270, change " D < I ) =50 " to " D ( I ) = 5 s " . We appreciate Mr. Lynch's correction. One Feed (FromPage9) 4. The result is that two carriage returns were issued and the blank line is created. 5. The printer then went on to print the contents of program line 2. The reason the second program worked correctly is that the computer did not send a carriage return until the entire message was printed. How can you stop this from happen- ing? In the first program, at the end of line 1, add a quote mark (") to end the mate- rial to be printed, and then add a semi- colon (;). The semi-colon at the end of the first line will suppress (prevent) the auto- matic carriage return and the print-out will be correct. Now line 1 in the first program looks like this: i LPR.INT"12345G78901 234567890123 456789012" ; And the print-out looks like this: 12345678901234567890123456789012 See what I mean? COMPUTER SERVICES ADDRESS AND PHONE NUMBERS 8 AM to 7 PM Central Time Computer Services 900 Two Tandy Center Fort Worth, Texas 76102 1-800-433-1679 (WATS Except Texas) 1-800-772-5914 (WATS Inside Texas) 1-817-390-3583 (Switchboard) TRS-80 Microcomputer News: © 1981 Tandy Corporation, Fort Worth, Texas 76102 U.S.A. All Rights Reserved Reproduction or use, without express written permission from Tandy Corporation of any portion of this News- letter is prohibited. Permission is specifi- cally granted to individuals to use or reproduce this material for their personal, non-commercial use. Reprint permission, with notice of source, is also specifically granted to non-profit clubs, organizations, educational institutions, and Newsletters. TRS-80 Microcomputer News is published monthly by Radio Shack, a division of Tandy Corporation. A single one year subscription is available free to purchasers of new TRS-80 Micro- computer systems with addresses in the United States, Puerto Rico, and APO or'FPO addresses. Subscriptions to other addresses are not available. The subscription rate for renewals and other inter- ested persons is twelve dollars ($12,00) per year, check or money order in U.S. funds. All correspon- dence related to subscriptions should be sent to: Microcomputer News, P.O. Box 2910, Fort Worth, Texas 76101. Back issues of Microcomputer News are not available. The TRS-80 Newsletter welcomes the receipt of computer programs, or other material which you would like to make available to users of TRS- 80 Microcomputer systems. In order for us to reprint your submission, you must specifically request that your material be considered for reprinting in the newsletter and provide no notice that you retain copyrights or other exclusive rights in the material. This assures that our readers m£iy be permitted to recopy and use your material without creating any legal hassles. 20 Microcomputer NEWS, April 1981