home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1991-12-02 | 3.6 KB | 101 lines |
- 10 REM
- 20 REM *** (c) Copyright 1987 by Robert Woeger. All rights reserved. ***
- 30 REM *** This program allows you to modify HDIR.COM to your favorite***
- 40 REM *** colors. HDIR.COM must be in the current drive/directory. ***
- 50 REM *** It will produce a file called H.COM which is the modified ***
- 60 REM *** version of HotDIR. Simply delete the old HDIR.COM and ***
- 70 REM *** rename H.COM to HDIR.COM to get the updated version. ***
- 80 REM *** You may modify this HDIRCOLS.BAS program to meet your ***
- 90 REM *** customization needs. This program was written to do the ***
- 100 REM *** job of color customization of HotDIR in a fairly quick and ***
- 110 REM *** dirty fashion. We are providing the BASIC source code so ***
- 120 REM *** you can modify it and hopefully improve it. We are having ***
- 130 REM *** a contest! We are looking for a better HDIRCOLS.BAS! If ***
- 140 REM *** you have written a new or modified HDIRCOLS.BAS, please ***
- 150 REM *** submit your program and we may use it in our next release ***
- 160 REM *** of the Xanadu Utilities. We will give you credit in the ***
- 170 REM *** Xanadu Utilities documentation if we choose your program. ***
- 180 REM *** Send to Rob Woeger, 911 Enfield St., Bryan, TX 77802. ***
- 190 REM
- 200 KEY OFF:CLEAR 5000:DIM CL$(16)
- 210 FOR I=0 TO 15:READ CL$(I):NEXT I
- 220 OPEN "R",1,"HDIR.COM",128
- 230 OPEN "R",2,"H.COM",128
- 240 FIELD #1,128 AS A$
- 250 FIELD #2,128 AS B$
- 260 TOTAL = LOF(1):TOTAL = TOTAL/128+1
- 270 GET #1,1
- 280 LSET B$=A$
- 290 PUT #2,1
- 300 GET #1,2
- 310 C$=A$
- 320 CLS
- 330 PRINT"HotDIR Color Customization Program for HotDIR Version 2.1 Only."
- 340 PRINT
- 350 PRINT "Your current file extensions/colors are:"
- 360 PRINT
- 370 FOR I=1 TO 30
- 380 IF (I)/2=INT((I)/2) THEN PRINT TAB(40);
- 390 D$=MID$(C$,4*(I-1)+2,4)
- 400 IF LEFT$(D$,1)=CHR$(0) OR LEFT$(D$,1)="?" THEN 450
- 410 PRINT LEFT$(D$,3);" is ";
- 420 GOSUB 940
- 430 IF I/2=INT(I/2) THEN PRINT
- 440 NEXT I
- 450 PRINT:PRINT"Would you like to A)dd a new extension/color"
- 460 PRINT " or M)odify an existing extension/color"
- 470 PRINT " or S)ave the updated HotDIR? ";
- 480 LAST = I : REM * Save location of last empty extension *
- 490 LINE INPUT Q$
- 500 IF LEN(Q$)<>1 THEN 320
- 510 IF Q$="s" OR Q$="S" THEN 550
- 520 IF Q$="m" OR Q$="M" THEN 640
- 530 IF Q$="a" OR Q$="A" THEN 820
- 540 GOTO 320
- 550 REM * Save the entire HDIR.COM file and include modified sector, if any *
- 560 LSET B$=C$
- 570 PUT #2,2
- 580 FOR I=3 TO TOTAL
- 590 GET #1,I
- 600 LSET B$=A$
- 610 PUT #2,I
- 620 NEXT I
- 630 GOTO 930
- 640 REM * Modify an existing extension/color pair *
- 650 PRINT:PRINT"What extension would you like to modify";
- 660 INPUT N$
- 670 FOR I=1 TO 30
- 680 G$=MID$(C$,4*(I-1)+2,4):H$=LEFT$(G$,3)
- 690 IF H$<>N$ THEN NEXT I
- 700 IF H$<>N$ THEN PRINT:PRINT"Extension not found! Hit enter to return to main menu.":LINE INPUT N$:GOTO 320
- 710 REM * Extension found - let's modify it if they want to *
- 720 PRINT"Extension: ";H$;" is currently ";
- 730 D$=G$:GOSUB 940
- 740 PRINT "."
- 750 PRINT"Enter new color number (0-15 recommended)";
- 760 C=-1
- 770 INPUT C
- 780 IF C=-1 THEN 810
- 790 IF C<0 OR C>255 THEN PRINT:PRINT"Invalid value (Must be 0-255).":GOTO 710
- 800 MID$(C$,4*(I-1)+2,4) = H$ + CHR$(C)
- 810 GOTO 320
- 820 REM * Add a new extension and color *
- 830 IF LAST >29 THEN PRINT:PRINT"Sorry, all extension slots are full. Can't add a new one.:?"HIT ENTER TO CONTINUE.":line input q$:goto 90
- 840 PRINT:PRINT"What is the extension name you want to add";
- 850 INPUT E$
- 860 IF LEN(E$)=0 OR LEN(E$)>3 THEN GOTO 840
- 870 PRINT"What color for ";E$;" (Enter a color number between 0 and 255)";
- 880 INPUT C
- 890 IF C<0 OR C>255 THEN PRINT:PRINT"Invalid color value (Must be 0-255).":GOTO 870
- 900 MID$(C$,4*(LAST-1)+2,3) = E$
- 910 MID$(C$,4*(LAST-1)+5,1) = CHR$(C)
- 920 GOTO 320
- 930 END
- 940 A=ASC(RIGHT$(D$,1))
- 950 IF A<0 OR A>15 THEN PRINT "Color #";A;:GOTO 970
- 960 PRINT CL$(A);
- 970 RETURN
- 980 DATA "Black","Blue","Green","Cyan","Red","Magenta","Brown","White"
- 990 DATA "Gray","Light Blue","Light Green","Light Cyan","Light Red"
- 1000 DATA "Light Magenta","Yellow","Hi-intensity White"
-