home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
busi
/
fri150_2.zip
/
CONVNAME.BAS
< prev
next >
Wrap
BASIC Source File
|
1988-10-09
|
5KB
|
136 lines
' Program name: CONVNAME.BAS
'
' This program is an accessory to the FRIDAY series. It converts
' the file names created by early version of FRIDAY to a format
' that is readable by the 1.50 version.
'
' Written by Dave wilson
' Dated 10-08-88
'
' Note: This program requires the ADVBAS v4.0 Library. The routines
' used are: exist, findfirstf, findnextf, and getnamef.
'
' ADVBAS is the registered Trademark of Thomas Hanlin III
'
'
'
CLS
LOCATE 1, 1: PRINT "Friday Accessory Program v1.00 - Convert File Names"
LOCATE 2, 1: PRINT " written by David A. Wilson"
LOCATE 6, 1: PRINT " Due to an oversight on my part, the file names in versions earlier than"
PRINT "1.50 of FRIDAY will not sort correctly if files of differing years are"
PRINT "included in the list. The reason for this is because the year occurs"
PRINT "in the last two digits of the name string. This incorrectly weights the"
PRINT "string. Version 1.50 corrects this oversight, but now will not correctly"
PRINT "recognize files created using previous versions. This program reads"
PRINT "and converts the string format created by earlier versions to one that"
PRINT "can be recognized by Friday 1.50. "
PRINT : PRINT " To use CONVNAME place your disk containing FRIDAY files with the"
PRINT "extensions .APP, .NOT, .TD in drive A:. Press the space bar when"
PRINT "you are ready to begin conversion. CONVNAME will do the rest. "
PRINT : PRINT " Alternatively, you may rename your files manually. Using any DOS editor,"
PRINT "load APPOINT.APP and in the overstrike; mode, place the year at the"
PRINT "beginning of the file name. "
PRINT
PRINT "-more-"
pause$ = ""
DO WHILE pause$ = ""
pause$ = INKEY$
LOOP
CLS
PRINT "For example: suppose you had the following list contained in APPOINT.APP"
PRINT : PRINT " 10088800010020001000"
PRINT " 10098811111000000000"
PRINT : PRINT "Using the editor, change these files to read"
PRINT : PRINT " 88100800010020001000"
PRINT " 88100911111000000000"
PRINT : PRINT "Now, go to a copy of your disk and rename all .APP, .NOT,"
PRINT "and .TD files so that the format follows the sequence:"
PRINT : PRINT " year;month;day.ext"
PRINT " 093088.NOT becomes 880930.NOT"
PRINT : PRINT "If you have trouble converting files, call or write and I will"
PRINT "help in whatever way I can. Dave Wilson"
PRINT " 37 Pikehall Pl."
PRINT " Baltimore, MD 21236"
PRINT " (301) 529-2009"
PRINT "Press <SPACE BAR> to begin conversion, any other key to QUIT."
pause$ = ""
DO WHILE pause$ = ""
pause$ = INKEY$
LOOP
CLS
IF pause$ <> CHR$(32) THEN PRINT "FRIDAY conversion program terminated."
'===================Conversion routine ===================================
CLS
FOR i = 1 TO 3
counter = 1
DO
SELECT CASE i
CASE 1
fil$ = "*.NOT"
ext$ = ".NOT"
CASE 2
fil$ = "*.TD"
ext$ = ".TD"
CASE 3
fil$ = "*.APP"
ext$ = ".APP"
END SELECT
fil$ = fil$ + CHR$(0)
IF counter = 1 THEN
CALL findfirstf("a:\" + fil$, attr%, ercd%)
IF ercd% THEN PRINT "No additional " + ext$ + " files found": PRINT : EXIT DO
ELSE
CALL findnextf(ercd%)
IF ercd% THEN PRINT "No additional " + ext$ + " files found": PRINT : EXIT DO
END IF
fil$ = SPACE$(12)
newfil$ = SPACE$(6) + ext$
CALL getnamef(fil$, flen%)
oldfil$ = LEFT$(fil$, flen%)
IF LEFT$(oldfil$, 8) <> "APPOINTS" AND LEFT$(oldfil$, 7) <> "REOCCUR" AND LEFT$(oldfil$, 8) <> "OLDAPPTS" THEN
yr$ = MID$(oldfil$, 5, 2): moday$ = LEFT$(oldfil$, 4)
MID$(newfil$, 1, 2) = yr$: MID$(newfil$, 3, 4) = moday$
PRINT oldfil$ + " ==> " + newfil$
SHELL "rename a:" + oldfil$ + " " + newfil$
counter = counter + 1
ELSE
END IF
LOOP
NEXT i
PRINT : PRINT "Rewriting APPOINTS.APP"
PRINT : PRINT "WARNING: Do not terminate or data will be lost."
PRINT
CALL exist("a:appoints.app" + CHR$(0), filexists%)
IF filexists% THEN
OPEN "a:appoints.app" FOR INPUT AS #1
OPEN "a:temp.$$$" FOR OUTPUT AS #2
WHILE NOT EOF(1)
INPUT #1, a$
PRINT a$ + " => ";
yr$ = MID$(a$, 5, 2): moday$ = LEFT$(a$, 4)
MID$(a$, 1, 2) = yr$: MID$(a$, 3, 4) = moday$
PRINT #2, a$
PRINT a$
WEND
PRINT
CLOSE 1, 2
KILL "a:appoints.app"
SHELL "rename a:temp.$$$ appoints.app>nul"
PRINT "File conversion successfully completed."
PRINT
ELSE
PRINT "APPOINTS.APP not found."
PRINT
END IF
END