Get 20M+ Full-Text Papers For Less Than $1.50/day. Start a 14-Day Trial for You and Your Team.

Learn More →

The Lucky 13 BASIC Utility Programs

The Lucky 13 BASIC Utility Programs The Lucky 13: BASIC Utility Programs Mar k Bendig Reference and Enhanced Information Sen-ices On the disk accompanying this issue of case, a search for " red " will find Red red OUTLINES— Makes a copy of a file, trun­ OCLC Micro, you'll find 13 utility pro­ and RED; it won't find red, red-, or cating (chopping off) all lines grams written in BASIC. All of these pro­ reduce. FGREP also allows you to search that exceed a specified grams were written for a presentation at groups of files using wildcards, even *.*] length. the recent 1989 Computers in Libraries OUTLINES can be used to process a PRINTOUT—Prints out an ASCII text file, conference (formerly called Small Compu­ text file before using it as input to a pro­ skipping over the perfora­ ters in Libraries). The programs demon­ gram that has a line length restriction. tions in the printer paper strate what you can do using relatively and printing the file name simple programs you can write yourself. and page number on the top Printe r Control (Remember that you already have of each page. BASIC—it comes with your PC.) PRTASCII— Sends a specified series of After the pages have been separated, The programs may benefit you on any ASCII codes to the printer. the document can be stapled or put in a of three levels. First, you may want to use This program can be used to set up binder for convenient reference. the programs "as-is." Most of them do special print modes or to control printer LINECT— Tells how many lines and things you're likely to need from time to functions such as form feed. how many characters are in time. You may also want to modify the a specified file. programs to more closely fit your needs or continued on page 23 to spruce up the user interface a bit. Fi­ 10 CLS:KEY OFF nally, some of the illustrated techniques 20 PRINT "SOUNDS -- Demonstrates audio capabilities of BASIC" (for example, several approaches to menu 30 COLOR 0,7 handling) may be useful to you in your 40 PRINT " Press Ctrl/Break and enter 'SYSTEM' to terminate program. "; 50 FOR I=1 TO 20:PRINT " ";:NEXT I own programming projects. 60 COLOR 7,0 Here's a rundown, by category, of the 70 PRINT:PRINT "lucky 13" programs and what they do. 80 PRINT "This program uses the BEEP, SOUND, and PLAY commands to demonstrate" 90 PRINT "the audio capabilities of BASIC. You may want to incorporate" 100 PRINT "some of these effects into your programs. Complete descriptions" 110 PRINT "of the commands used will be found in your BASIC manual." File Processing 120 SEL=-1 130 LOCATE 11,1 COPYDEL— Makes a copy of a file, delet­ 140 PRINT TAB(20)" * SOUNDS Menu *":PRINT ing all lines containing a 150 PRINT TAB(20)" 1 - BEEP" character string entered by 160 PRINT TAB(20)" 2 - Warble" the user. 170 PRINT TAB(20)" 3 - Star Wars" 180 PRINT TAB(20)" 4 - Random Melody" This program could be used, for ex­ 190 PRINT TAB(20)" 5 - At the Races":PRINT ample, to remove all lines containing a 200 LOCATE 19,20:INPUT " Your choice: ",X$ given tag from a file of bibliographic rec­ 210 IF X$ = "" THEN IF SEL=-1 GOTO 200 ELSE GOTO 230 220 SEL=VAL(XS) ords. It can easily be modified to change 230 IF SEL<1 OR SEL>5 THEN 200 the basis for deleting lines. 240 LOCATE 12+SEL,22:PRINT "-->"; 250 ON SEL GOTO 260,270,310,350,390 DSPLINES— Goes through a file, display­ 260 BEEP:GOTO 130 ing all lines containing a 270 FOR I=1 TO 5 character string entered by 280 SOUND 880,5:SOUND 440,5 290 NEXT the user. 300 GOTO 130 DSPLINES could be used to display all 310 FOR J=100 TO 200 lines containing a given tag in a file of biblio­ 320 SOUND J,.8 graphic records. As written, it's simply an­ 330 NEXT J 340 GOTO 130 other implementation of the searching capa­ 350 FOR I=1 TO 20 bility offered by the DOS FIND command. 360 SOUND 200+1400*RND,2+16*RND However, since it's a BASIC file, you could 370 NEXT I modify the search argument to incorporate 380 GOTO 130 390 PLAY "T32 03 P4 D12 G12 B12" IF conditions. [FGREP—pronounced F 400 PLAY "04 D16. D32 D8 03 B16. B32 B8" Grep—also on Disk 9, is yet another im­ 410 PLAY "G12 B12 G12 D2" plementation of character string searching. 420 PLAY "D12 B12 G12" 430 PLAY "04 D16. D32 D8 D12 03 B12 G12" Unlike FIND and DSPLINES, it's not case- 440 PLAY "D16. D32 D8 G4" sensitive. If you choose to have it ignore 450 GOTO 130 Fig.l Listing of SOUNDS 8 OCLC Micro Vol. 5, No. 2 April 1989 http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png OCLC Micro Emerald Publishing

The Lucky 13 BASIC Utility Programs

OCLC Micro , Volume 5 (2): 1 – Feb 1, 1989

Loading next page...
 
/lp/emerald-publishing/the-lucky-13-basic-utility-programs-QsX2nI7UB8
Publisher
Emerald Publishing
Copyright
Copyright © Emerald Group Publishing Limited
ISSN
8756-5196
DOI
10.1108/EUM0000000003561
Publisher site
See Article on Publisher Site

Abstract

The Lucky 13: BASIC Utility Programs Mar k Bendig Reference and Enhanced Information Sen-ices On the disk accompanying this issue of case, a search for " red " will find Red red OUTLINES— Makes a copy of a file, trun­ OCLC Micro, you'll find 13 utility pro­ and RED; it won't find red, red-, or cating (chopping off) all lines grams written in BASIC. All of these pro­ reduce. FGREP also allows you to search that exceed a specified grams were written for a presentation at groups of files using wildcards, even *.*] length. the recent 1989 Computers in Libraries OUTLINES can be used to process a PRINTOUT—Prints out an ASCII text file, conference (formerly called Small Compu­ text file before using it as input to a pro­ skipping over the perfora­ ters in Libraries). The programs demon­ gram that has a line length restriction. tions in the printer paper strate what you can do using relatively and printing the file name simple programs you can write yourself. and page number on the top Printe r Control (Remember that you already have of each page. BASIC—it comes with your PC.) PRTASCII— Sends a specified series of After the pages have been separated, The programs may benefit you on any ASCII codes to the printer. the document can be stapled or put in a of three levels. First, you may want to use This program can be used to set up binder for convenient reference. the programs "as-is." Most of them do special print modes or to control printer LINECT— Tells how many lines and things you're likely to need from time to functions such as form feed. how many characters are in time. You may also want to modify the a specified file. programs to more closely fit your needs or continued on page 23 to spruce up the user interface a bit. Fi­ 10 CLS:KEY OFF nally, some of the illustrated techniques 20 PRINT "SOUNDS -- Demonstrates audio capabilities of BASIC" (for example, several approaches to menu 30 COLOR 0,7 handling) may be useful to you in your 40 PRINT " Press Ctrl/Break and enter 'SYSTEM' to terminate program. "; 50 FOR I=1 TO 20:PRINT " ";:NEXT I own programming projects. 60 COLOR 7,0 Here's a rundown, by category, of the 70 PRINT:PRINT "lucky 13" programs and what they do. 80 PRINT "This program uses the BEEP, SOUND, and PLAY commands to demonstrate" 90 PRINT "the audio capabilities of BASIC. You may want to incorporate" 100 PRINT "some of these effects into your programs. Complete descriptions" 110 PRINT "of the commands used will be found in your BASIC manual." File Processing 120 SEL=-1 130 LOCATE 11,1 COPYDEL— Makes a copy of a file, delet­ 140 PRINT TAB(20)" * SOUNDS Menu *":PRINT ing all lines containing a 150 PRINT TAB(20)" 1 - BEEP" character string entered by 160 PRINT TAB(20)" 2 - Warble" the user. 170 PRINT TAB(20)" 3 - Star Wars" 180 PRINT TAB(20)" 4 - Random Melody" This program could be used, for ex­ 190 PRINT TAB(20)" 5 - At the Races":PRINT ample, to remove all lines containing a 200 LOCATE 19,20:INPUT " Your choice: ",X$ given tag from a file of bibliographic rec­ 210 IF X$ = "" THEN IF SEL=-1 GOTO 200 ELSE GOTO 230 220 SEL=VAL(XS) ords. It can easily be modified to change 230 IF SEL<1 OR SEL>5 THEN 200 the basis for deleting lines. 240 LOCATE 12+SEL,22:PRINT "-->"; 250 ON SEL GOTO 260,270,310,350,390 DSPLINES— Goes through a file, display­ 260 BEEP:GOTO 130 ing all lines containing a 270 FOR I=1 TO 5 character string entered by 280 SOUND 880,5:SOUND 440,5 290 NEXT the user. 300 GOTO 130 DSPLINES could be used to display all 310 FOR J=100 TO 200 lines containing a given tag in a file of biblio­ 320 SOUND J,.8 graphic records. As written, it's simply an­ 330 NEXT J 340 GOTO 130 other implementation of the searching capa­ 350 FOR I=1 TO 20 bility offered by the DOS FIND command. 360 SOUND 200+1400*RND,2+16*RND However, since it's a BASIC file, you could 370 NEXT I modify the search argument to incorporate 380 GOTO 130 390 PLAY "T32 03 P4 D12 G12 B12" IF conditions. [FGREP—pronounced F 400 PLAY "04 D16. D32 D8 03 B16. B32 B8" Grep—also on Disk 9, is yet another im­ 410 PLAY "G12 B12 G12 D2" plementation of character string searching. 420 PLAY "D12 B12 G12" 430 PLAY "04 D16. D32 D8 D12 03 B12 G12" Unlike FIND and DSPLINES, it's not case- 440 PLAY "D16. D32 D8 G4" sensitive. If you choose to have it ignore 450 GOTO 130 Fig.l Listing of SOUNDS 8 OCLC Micro Vol. 5, No. 2 April 1989

Journal

OCLC MicroEmerald Publishing

Published: Feb 1, 1989

There are no references for this article.