Silicon ChipComputer Bits - October 1994 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Writing to Silicon Chip
  4. Feature: Dolby Surround Sound: How It Works by Leo Simpson
  5. Feature: Electronic Engine Management; Pt.13 by Julian Edgar
  6. Order Form
  7. Project: Beginner's Dual Rail Variable Power Supply by Darren Yates
  8. Project: Build A Talking Headlight Reminder by Darren Yates
  9. Project: Electronic Ballast For Fluorescent Lights by John Clarke
  10. Serviceman's Log: Two symptoms - one fault or two? by The TV Serviceman
  11. Project: Temperature Controlled Soldering Station by Jeff Monegal
  12. Book Store
  13. Vintage Radio: The winners of the Hellier Award by John Hill
  14. Product Showcase
  15. Feature: Computer Bits by Darren Yates
  16. Back Issues
  17. Notes & Errata: 40V/3A Adjustable Power Supply, January & February 1994; 12-240VAC 200W Inverter, February 1994
  18. Market Centre
  19. Advertising Index
  20. Outer Back Cover

This is only a preview of the October 1994 issue of Silicon Chip.

You can view 33 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Electronic Engine Management; Pt.1 (October 1993)
  • Electronic Engine Management; Pt.1 (October 1993)
  • Electronic Engine Management; Pt.2 (November 1993)
  • Electronic Engine Management; Pt.2 (November 1993)
  • Electronic Engine Management; Pt.3 (December 1993)
  • Electronic Engine Management; Pt.3 (December 1993)
  • Electronic Engine Management; Pt.4 (January 1994)
  • Electronic Engine Management; Pt.4 (January 1994)
  • Electronic Engine Management; Pt.5 (February 1994)
  • Electronic Engine Management; Pt.5 (February 1994)
  • Electronic Engine Management; Pt.6 (March 1994)
  • Electronic Engine Management; Pt.6 (March 1994)
  • Electronic Engine Management; Pt.7 (April 1994)
  • Electronic Engine Management; Pt.7 (April 1994)
  • Electronic Engine Management; Pt.8 (May 1994)
  • Electronic Engine Management; Pt.8 (May 1994)
  • Electronic Engine Management; Pt.9 (June 1994)
  • Electronic Engine Management; Pt.9 (June 1994)
  • Electronic Engine Management; Pt.10 (July 1994)
  • Electronic Engine Management; Pt.10 (July 1994)
  • Electronic Engine Management; Pt.11 (August 1994)
  • Electronic Engine Management; Pt.11 (August 1994)
  • Electronic Engine Management; Pt.12 (September 1994)
  • Electronic Engine Management; Pt.12 (September 1994)
  • Electronic Engine Management; Pt.13 (October 1994)
  • Electronic Engine Management; Pt.13 (October 1994)
Items relevant to "Beginner's Dual Rail Variable Power Supply":
  • Beginner's Dual Rail Variable Power Supply PCB pattern (PDF download) [04110941] (Free)
Items relevant to "Build A Talking Headlight Reminder":
  • Talking Headlight Reminder PCB pattern (PDF download) [01109941] (Free)
Items relevant to "Electronic Ballast For Fluorescent Lights":
  • Electronic Ballast For Fluorescent Tubes PCB pattern (PDF download) [11309941] (Free)
Items relevant to "Computer Bits":
  • DOS software for Computer Bits, October 1994 (DIRSPLIT.EXE/BAS) (Free)
Articles in this series:
  • Computer Bits (July 1989)
  • Computer Bits (July 1989)
  • Computer Bits (August 1989)
  • Computer Bits (August 1989)
  • Computer Bits (September 1989)
  • Computer Bits (September 1989)
  • Computer Bits (October 1989)
  • Computer Bits (October 1989)
  • Computer Bits (November 1989)
  • Computer Bits (November 1989)
  • Computer Bits (January 1990)
  • Computer Bits (January 1990)
  • Computer Bits (April 1990)
  • Computer Bits (April 1990)
  • Computer Bits (October 1990)
  • Computer Bits (October 1990)
  • Computer Bits (November 1990)
  • Computer Bits (November 1990)
  • Computer Bits (December 1990)
  • Computer Bits (December 1990)
  • Computer Bits (January 1991)
  • Computer Bits (January 1991)
  • Computer Bits (February 1991)
  • Computer Bits (February 1991)
  • Computer Bits (March 1991)
  • Computer Bits (March 1991)
  • Computer Bits (April 1991)
  • Computer Bits (April 1991)
  • Computer Bits (May 1991)
  • Computer Bits (May 1991)
  • Computer Bits (June 1991)
  • Computer Bits (June 1991)
  • Computer Bits (July 1991)
  • Computer Bits (July 1991)
  • Computer Bits (August 1991)
  • Computer Bits (August 1991)
  • Computer Bits (September 1991)
  • Computer Bits (September 1991)
  • Computer Bits (October 1991)
  • Computer Bits (October 1991)
  • Computer Bits (November 1991)
  • Computer Bits (November 1991)
  • Computer Bits (December 1991)
  • Computer Bits (December 1991)
  • Computer Bits (January 1992)
  • Computer Bits (January 1992)
  • Computer Bits (February 1992)
  • Computer Bits (February 1992)
  • Computer Bits (March 1992)
  • Computer Bits (March 1992)
  • Computer Bits (May 1992)
  • Computer Bits (May 1992)
  • Computer Bits (June 1992)
  • Computer Bits (June 1992)
  • Computer Bits (July 1992)
  • Computer Bits (July 1992)
  • Computer Bits (September 1992)
  • Computer Bits (September 1992)
  • Computer Bits (October 1992)
  • Computer Bits (October 1992)
  • Computer Bits (November 1992)
  • Computer Bits (November 1992)
  • Computer Bits (December 1992)
  • Computer Bits (December 1992)
  • Computer Bits (February 1993)
  • Computer Bits (February 1993)
  • Computer Bits (April 1993)
  • Computer Bits (April 1993)
  • Computer Bits (May 1993)
  • Computer Bits (May 1993)
  • Computer Bits (June 1993)
  • Computer Bits (June 1993)
  • Computer Bits (October 1993)
  • Computer Bits (October 1993)
  • Computer Bits (March 1994)
  • Computer Bits (March 1994)
  • Computer Bits (May 1994)
  • Computer Bits (May 1994)
  • Computer Bits (June 1994)
  • Computer Bits (June 1994)
  • Computer Bits (July 1994)
  • Computer Bits (July 1994)
  • Computer Bits (October 1994)
  • Computer Bits (October 1994)
  • Computer Bits (November 1994)
  • Computer Bits (November 1994)
  • Computer Bits (December 1994)
  • Computer Bits (December 1994)
  • Computer Bits (January 1995)
  • Computer Bits (January 1995)
  • Computer Bits (February 1995)
  • Computer Bits (February 1995)
  • Computer Bits (March 1995)
  • Computer Bits (March 1995)
  • Computer Bits (April 1995)
  • Computer Bits (April 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • Computer Bits (July 1995)
  • Computer Bits (July 1995)
  • Computer Bits (September 1995)
  • Computer Bits (September 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits (December 1995)
  • Computer Bits (December 1995)
  • Computer Bits (January 1996)
  • Computer Bits (January 1996)
  • Computer Bits (February 1996)
  • Computer Bits (February 1996)
  • Computer Bits (March 1996)
  • Computer Bits (March 1996)
  • Computer Bits (May 1996)
  • Computer Bits (May 1996)
  • Computer Bits (June 1996)
  • Computer Bits (June 1996)
  • Computer Bits (July 1996)
  • Computer Bits (July 1996)
  • Computer Bits (August 1996)
  • Computer Bits (August 1996)
  • Computer Bits (January 1997)
  • Computer Bits (January 1997)
  • Computer Bits (April 1997)
  • Computer Bits (April 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Computer Bits (July 1997)
  • Computer Bits (July 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits (September 1997)
  • Computer Bits (September 1997)
  • Computer Bits (October 1997)
  • Computer Bits (October 1997)
  • Computer Bits (November 1997)
  • Computer Bits (November 1997)
  • Computer Bits (April 1998)
  • Computer Bits (April 1998)
  • Computer Bits (June 1998)
  • Computer Bits (June 1998)
  • Computer Bits (July 1998)
  • Computer Bits (July 1998)
  • Computer Bits (November 1998)
  • Computer Bits (November 1998)
  • Computer Bits (December 1998)
  • Computer Bits (December 1998)
  • Control Your World Using Linux (July 2011)
  • Control Your World Using Linux (July 2011)
COMPUTER BITS BY DARREN YATES Placing directories into programs Unless you have Visual BASIC or some other high level language, getting DOS directories into your programs is not always easy. This month, we show you how you can do it with QBasic and QuickBASIC 4.5. This month’s column is the result of a letter from a reader wanting to know how to get a directory listing from the screen into one of his programs. This is actually a quite common thing to do, particularly if you work with Windows or Visual BASIC. However, it’s a little more difficult to do it in Quick BASIC than just clicking on an icon. Firstly, there is no direct command in BASIC you can use apart from the FILES command and this simply displays a list of files on the screen. You can determine which files come up –not how they appear – by using the familiar wildcard commands. In fact, the files appear pretty much as they would get if you used the DOS command “DIR/W”. Most of the time, this isn’t very use­ful, particularly if you type FILES C:|WINDOWS (for example) and 100+ files fly past your eyes, or if you need to know the size of a certain file before loading it into the system. For QuickBASIC users, there are essentially two methods. The first is to take it directly from the drive. This can be done using some extra DOS interrupts that we have yet to cover. You can do what’s called an “absolute read” of a certain sector of a track where DOS stores this information. This is by far the most elegant method but it can be dangerous if you plug in the wrong command. It doesn’t take much to rewrite your directory and upset the whole disc. It’s also fairly 88  Silicon Chip difficult to do and that’s with the right information at hand. The DOS interrupts also allow you to do an “absolute write” to any sector of any track but you don’t get any second warnings. In fact, you don’t even get a first warning that you will lose any information currently stored in that location. It simply wipes over the top. The redirect command The second method is more cumbersome but is much safer and easier to do. It involves using the DOS redirect command, “>”. Every time you do a DIR in DOS, your PC directs the directory output to your screen so you can see all of the files. However, by using the “>” command, you can direct this output into an ASCII file on disc. For example, if you type the command “DIR > DIRLIST.TXT”, DOS will create the file DIRLIST.TXT and dump the complete list­ ing of the current directory into that file. You can then use EDIT to do what you like with that file. More importantly, you can now use Quick/QBasic to do what you like with the file. The good thing about the file is that it is columnated; ie, each subpart of the directory listing begins at a particular column. For example, the first part of the filename begins at column 1 and has a maximum of eight letters; the three-letter maximum extension begins at column 10. The size of the file begins at column 14 and the start of the date at column 24. And finally, the time begins at column 34. You can easily extract each of these five file parameters by using the MID$ command. An example of this is shown in the program DIRSPLIT.BAS – see listing. This program is designed to handle a directory which has up to 400 files. If you expect to have a bigger directory, simply extend the dimension from 400 to whatever you think you need. The next series of dimension statements set up our five parameter arrays, one each for filename, extension, file size, date and time. Using the LINE INPUT statement to read in one line of the directory listing at a time, the WHILE NOT EOF(1) loop and the MID$ command enables us to extract each of the parameters. These parameters are then stored in suitably named arrays: FILENAME, EXTENSION, FILESIZE, DATE and TIME. The dimension of each array is arranged so that the first element of each array refers to one file, the next element to the next file and so on. The second half of the program prints this information on screen. The TAB statements ensure that the directory listing uses the whole screen rather than just half of it as the normal DIR statement uses. The VIEW PRINT command allows the top two lines (ie, the column titles) to stay on screen at all times, while the FOR NEXT loop enables you to page through the directory. This is handy when you have more than one screen of files in a directory. To run the program, you simply type DIRSPLIT<enter> and it will display the contents of the current disc and directory. Copies of DIRSPLIT.BAS/OBJ/EXE will be available on 3.5-inch or 5.25- Basic Listing For Dirsplit.bas Utility • TOROIDAL • CONVENTIONAL • POWER • OUTPUT • CURRENT • INVERTER • PLUGPACKS • CHOKES DIM dirline$(400) DIM filename(400) AS STRING * 8 DIM extention(400) AS STRING * 3 DIM filesize(400) AS STRING * 9 DIM date(400) AS STRING * 8 DIM time(400) AS STRING * 7 start = 0 SHELL “DIR > DIRLIST.TXT” OPEN “dirlist.txt” FOR INPUT AS #1 WHILE NOT EOF(1) lineno = lineno + 1 LINE INPUT #1, dirline$ ‘FILENAME filename(lineno) = MID$(dirline$, 1, 8) ‘EXTENSION extension(lineno) = MID$(dirline$, 10, 3) ‘FILESIZE filesize(lineno) = MID$(dirline$, 14, 9) ‘DATE date(lineno) = MID$(dirline$, 24, 8) ‘TIME time(lineno) = MID$(dirline$, 34, 7) WEND CLOSE #1 CLS PRINT TAB(1); “File”; TAB(15); “extension”; TAB(30); “File size”; TAB(50); “Date”; TAB(70); “Time” PRINT “————————————————————————————­­” VIEW PRINT 3 TO 24 WHILE linenum < lineno FOR linenum = start + 5 TO start + 24 IF linenum > lineno - 2 THEN GOTO endnext PRINT TAB(1); filename(linenum); PRINT TAB(15); extention(linenum); PRINT TAB(30); filesize(linenum); PRINT TAB(50); date(linenum); PRINT TAB(70); time(linenum); endnext: NEXT linenum PRINT : PRINT “Press <ENTER> key to continue. . .” a$ = INPUT$(1) start = start + 19 WEND inch discs for $7 plus $3 p&p from SILICON CHIP, PO Box 139, Collaroy Beach, NSW 2097. Alternatively, you TRANSFORMERS can order by phoning (02) 979 5644 or faxing (02) 979 6503 and quoting a SC credit card number. STOCK RANGE TOROIDALS BEST PRICES APPROVED TO AS 3108-1990 SPECIALS DESIGNED & MADE 15VA to 7.5kVA Tortech Pty Ltd 24/31 Wentworth St, Greenacre 2190 Phone (02) 642 6003 Fax (02) 642 6127 Silicon Chip Binders These beautifully-made binders will protect your copies of SILICON CHIP. They are made from a dis­ tinctive 2-tone green vinyl & will look great on your bookshelf. Price: $A11.95 plus $3 p&p each (NZ $6 p&p). Send your order to: Silicon Chip Publications PO Box 139 Collaroy Beach 2097 Or fax (02) 979 6503; or ring (02) 979 5644 & quote your credit card number. October 1994  89