home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
CDCOM.ZIP
/
CFGFILES.ZIP
/
CAROUSEL.ZIP
/
CONVERT.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-09-29
|
5KB
|
182 lines
DECLARE SUB fix.filename (filename$)
'convert.bas
'written by Eric L. Schonning for the CdCom door program
'this program will run under dos 5.00 qbasic.exe
'type qbasic convert to load, then press F5 to run
'you must copy the 35 description files off the cdrom disk before
'running this program. see makexrf.doc for the filenames
CLS
PRINT "Shareware Carousel Description Conversion Utility"
PRINT
PRINT "Modifying CAT Files Into Correct Format for MAKEXRF"
cl = CSRLIN
FOR i% = 1 TO 33
SELECT CASE i%
CASE 1
cf$ = "MASTER.CAT"
'macintosh
CASE 2
cf$ = "00APPL.CAT"
CASE 3
cf$ = "00CDEV.CAT"
CASE 4
cf$ = "00CODE.CAT"
CASE 5
cf$ = "00DA.CAT"
CASE 6
cf$ = "00DEMO.CAT"
CASE 7
cf$ = "00DOC.CAT"
CASE 8
cf$ = "00ED.CAT"
CASE 9
cf$ = "00FKEY.CAT"
CASE 10
cf$ = "00FONTS.CAT"
CASE 11
cf$ = "00HC.CAT"
CASE 12
cf$ = "00INIT.CAT"
CASE 13
cf$ = "00JOHN.CAT"
CASE 14
cf$ = "00LANG.CAT"
CASE 15
cf$ = "00MACII.CAT"
CASE 16
cf$ = "00MACTN.CAT"
CASE 17
cf$ = "00PATCHE.CAT"
CASE 18
cf$ = "00PICT.CAT"
CASE 19
cf$ = "00POSTSC.CAT"
CASE 20
cf$ = "00REVIEW.CAT"
CASE 21
cf$ = "00SOUNDS.CAT"
CASE 22
cf$ = "00TECH.CAT"
CASE 23
cf$ = "00UNIX.CAT"
CASE 24
cf$ = "00UTIL.CAT"
CASE 25
cf$ = "00UTILDK.CAT"
CASE 26
cf$ = "00UTILFL.CAT"
CASE 27
cf$ = "00UTILPN.CAT"
CASE 28
cf$ = "00VIRUS.CAT"
'c-64
CASE 29
cf$ = "064APPS.CAT"
CASE 30
cf$ = "064GAMES.CAT"
CASE 31
cf$ = "064MISC.CAT"
CASE 32
cf$ = "064MUSIC.CAT"
CASE 33
cf$ = "064UTILS.CAT"
END SELECT
LOCATE cl, 1: PRINT "Working on "; cf$; ","; i%; "of 33 "
OPEN cf$ FOR INPUT AS #1
SELECT CASE i%
CASE 1
FOR k% = 1 TO 33
i$ = STR$(k%): i$ = "0" + MID$(i$, 2): IF k% < 10 THEN i$ = "0" + i$
cf.tmp$ = i$ + ".CAT"
LOCATE cl + 1, 1: PRINT "Writing "; cf.tmp$
OPEN cf.tmp$ FOR OUTPUT AS #2
WHILE NOT EOF(1)
LINE INPUT #1, j$
IF j$ <> "" THEN
j$ = LEFT$(j$, 80)
SELECT CASE RIGHT$(j$, 3)
CASE i$
GOSUB file.ok
CASE "GIF"
IF i$ = "031" THEN GOSUB file.ok
CASE "PIC"
IF i$ = "032" THEN GOSUB file.ok
CASE "MAC"
IF i$ = "033" THEN GOSUB file.ok
CASE "HIL"
IF i$ = "021" THEN GOSUB file.ok
END SELECT
END IF
WEND
CLOSE #2
SEEK #1, 1
NEXT k%
CLOSE #1
KILL cf$
CASE 2 TO 28
IF i% = 23 OR i% = 21 OR i% = 4 THEN
FOR k% = 1 TO 4
LINE INPUT #1, j$
NEXT k%
END IF
OPEN "034.CAT" FOR APPEND AS #2
WHILE NOT EOF(1)
LINE INPUT #1, j$
IF j$ <> "" THEN
j$ = RTRIM$(j$)
IF LEN(j$) > 80 THEN j$ = LEFT$(j$, 80): j$ = RTRIM$(j$)
filename$ = LEFT$(j$, 12)
CALL fix.filename(filename$)
j$ = filename$ + MID$(j$, 13)
END IF
PRINT #2, j$
WEND
CLOSE
KILL cf$
CASE 29 TO 33
OPEN "035.CAT" FOR APPEND AS #2
WHILE NOT EOF(1)
LINE INPUT #1, j$
IF j$ <> "" THEN
j$ = RTRIM$(j$)
IF LEN(j$) > 80 THEN j$ = LEFT$(j$, 80): j$ = RTRIM$(j$)
filename$ = LEFT$(j$, 12)
CALL fix.filename(filename$)
j$ = filename$ + MID$(j$, 13)
END IF
PRINT #2, j$
WEND
CLOSE
KILL cf$
END SELECT
NEXT i%
PRINT
PRINT "Done"
END
file.ok:
j$ = LEFT$(j$, 77)
filename$ = LEFT$(j$, 12)
CALL fix.filename(filename$)
j$ = filename$ + MID$(j$, 13)
PRINT #2, j$
RETURN
SUB fix.filename (filename$)
'remove spaces between filename and extention
IF INSTR(filename$, CHR$(32)) = 0 THEN EXIT SUB
filename$ = RTRIM$(filename$)
'if instr(filename$,chr$(46)) = 0 then
pd = INSTR(filename$, CHR$(46))'check for "."
sp = INSTR(filename$, CHR$(32))
IF sp > pd THEN
ext$ = MID$(filename$, sp): ext$ = LTRIM$(ext$)
file8$ = LEFT$(filename$, sp - 1)
filename$ = file8$ + "." + ext$
IF LEN(filename$) < 12 THEN filename$ = filename$ + SPACE$(12 - LEN(filename$))
ELSE
IF LEN(filename$) < 12 THEN filename$ = filename$ + SPACE$(12 - LEN(filename$))
END IF
END SUB