home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
CDCOM.ZIP
/
CFGFILES.ZIP
/
CAROV2N1.ZIP
/
CONVERT.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-09-28
|
4KB
|
115 lines
DECLARE SUB fix.filename (filename$)
'convert.bas description conversion routine for CdCom door
'written by Eric L. Schonning
'works under dos 5.00 qbasic.exe (or qb 4.00 or greater)
'copy the following files from the cdrom disk to the current directory:
'filename size date time
'AMIGA.CAT 40532 08-20-90 7:59p
'ATARI.CAT 41554 08-20-90 12:19p
'COMDORE.CAT 97334 08-21-90 8:14p
'GRAPHIC.CAT 90460 07-12-90 11:42a
'MACTOSH.CAT 178513 08-21-90 1:59p
'MASTER.CAT 973174 08-13-90 2:15p
'MEAN_18.CAT 19535 08-20-90 4:18p
'then type qbasic convert, then press F5 to run
CLS
PRINT "Shareware Carousel Vol. 2 #1 Description Conversion"
PRINT
PRINT "Modifying CAT Files Into Correct Format For MAKEXRF"
cl = CSRLIN
FOR i% = 1 TO 7
SELECT CASE i%
CASE 1
cf$ = "MASTER.CAT"
CASE 2
cf$ = "AMIGA.CAT"
CASE 3
cf$ = "ATARI.CAT"
CASE 4
cf$ = "MEAN_18.CAT"
CASE 5
cf$ = "COMDORE.CAT"
CASE 6
cf$ = "MACTOSH.CAT"
CASE 7
cf$ = "GRAPHIC.CAT"
END SELECT
LOCATE cl, 1: PRINT "Working on "; cf$; ","; i%; "of 7 "
OPEN cf$ FOR INPUT AS #1
IF i% = 1 THEN
FOR k% = 1 TO 30
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$, 79)
IF RIGHT$(j$, 3) = i$ THEN
j$ = LEFT$(j$, 76)
filename$ = LEFT$(j$, 12)
CALL fix.filename(filename$)
j$ = filename$ + MID$(j$, 13)
PRINT #2, j$
END IF
'"GIF"," F","PIC","MAC"
'these files are in the graphic.cat, so don't dupe them here
END IF
WEND
CLOSE #2
SEEK #1, 1
NEXT k%
CLOSE #1
KILL cf$
ELSE
LOCATE cl + 1, 1: PRINT "Writing 0"; MID$(STR$(29 + i%), 2); ".CAT"
IF i% = 6 THEN LINE INPUT #1, j$
cf.tmp$ = LEFT$(cf$, INSTR(cf$, ".")) + "TMP"
OPEN cf.tmp$ FOR OUTPUT 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$)
IF i% = 7 THEN IF MID$(j$, LEN(j$) - 3, 3) = "GIF" THEN j$ = LEFT$(j$, LEN(j$) - 1)
filename$ = LEFT$(j$, 12)
CALL fix.filename(filename$)
j$ = filename$ + MID$(j$, 13)
END IF
PRINT #2, j$
WEND
CLOSE
KILL cf$
NAME cf.tmp$ AS cf$
END IF
NEXT i%
PRINT
PRINT "Done"
CLOSE
NAME "AMIGA.CAT" AS "031.CAT"
NAME "ATARI.CAT" AS "032.CAT"
NAME "MEAN_18.CAT" AS "033.CAT"
NAME "COMDORE.CAT" AS "034.CAT"
NAME "MACTOSH.CAT" AS "035.CAT"
NAME "GRAPHIC.CAT" AS "036.CAT"
END
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