home *** CD-ROM | disk | FTP | other *** search
- /* ConvertPrefs - © 1993 Matt Francis */
-
- IF ~EXISTS("ENVARC:AssignManager.prefs") THEN
- DO
- SAY "Can't find prefs file."
- EXIT
- END
-
- checkflag = 0
- OPEN(srcfile,"ENVARC:AssignManager.prefs")
- srcline = READLN(srcfile)
- IF EOF(srcfile) THEN
- DO
- SAY "Prefs file empty."
- EXIT
- END
- DO 5
- srcline = READLN(srcfile)
- END
- IF ~EOF(srcfile) THEN
- DO
- IF LENGTH(srcline) ~= 1 THEN checkflag = 1
- IF srcline < 0 | srcline > 3 THEN checkflag = 1
- END
- CLOSE(srcfile)
-
- IF checkflag THEN
- DO
- WRITECH(stdout,"Prefs file may already be converted. Continue anyway? ")
- PULL response
- IF LEFT(response,1) ~= "Y" THEN
- DO
- SAY "Conversion aborted."
- EXIT
- END
- END
-
- ADDRESS COMMAND "Copy ENVARC:AssignManager.prefs T:"
-
- OPEN(srcfile,"T:AssignManager.prefs")
- OPEN(dstfile,"ENVARC:AssignManager.prefs",W)
-
- srcline = READLN(srcfile)
- DO WHILE ~EOF(srcfile)
- WRITELN(dstfile,srcline)
- WRITELN(dstfile,READLN(srcfile))
- WRITELN(dstfile,READLN(srcfile))
- WRITELN(dstfile,"")
- srcline = READLN(srcfile)
- END
-
- CLOSE(dstfile)
- CLOSE(srcfile)
-
- ADDRESS COMMAND "Delete T:AssignManager.prefs QUIET"
- ADDRESS COMMAND "Copy ENVARC:AssignManager.prefs ENV:"
-
- SAY "Prefs successfully converted."
-