home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / busi / fri150_2.zip / CONVNAME.BAS < prev    next >
BASIC Source File  |  1988-10-09  |  5KB  |  136 lines

  1. '  Program name: CONVNAME.BAS
  2. '
  3. '  This program is an accessory to the FRIDAY series.  It converts
  4. '    the file names created by early version of FRIDAY to a format
  5. '    that is readable by the 1.50 version.
  6. '
  7. '  Written by Dave wilson
  8. '    Dated 10-08-88
  9. '
  10. '  Note:  This program requires the ADVBAS v4.0 Library.  The routines
  11. '         used are:   exist, findfirstf, findnextf, and getnamef.
  12. '
  13. '   ADVBAS is the registered Trademark of Thomas Hanlin III
  14. '
  15. '
  16. '
  17.    CLS
  18.    LOCATE 1, 1: PRINT "Friday Accessory Program v1.00 - Convert File Names"
  19.    LOCATE 2, 1: PRINT "  written by David A. Wilson"
  20.    LOCATE 6, 1: PRINT "  Due to an oversight on my part, the file names in versions earlier than"
  21.    PRINT "1.50 of FRIDAY will not sort correctly if files of differing years are"
  22.    PRINT "included in the list. The reason for this is because the year occurs"
  23.    PRINT "in the last two digits of the name string.  This incorrectly weights the"
  24.    PRINT "string. Version 1.50 corrects this oversight, but now will not correctly"
  25.    PRINT "recognize files created using previous versions.  This program reads"
  26.    PRINT "and converts the string format created by earlier versions to one that"
  27.    PRINT "can be recognized by Friday 1.50.  "
  28.    PRINT : PRINT "   To use CONVNAME place your disk containing FRIDAY files with the"
  29.    PRINT "extensions .APP, .NOT, .TD in drive A:.  Press the space bar when"
  30.    PRINT "you are ready to begin conversion.  CONVNAME will do the rest. "
  31.    PRINT : PRINT "   Alternatively, you may rename your files manually.  Using any DOS editor,"
  32.    PRINT "load APPOINT.APP and in the overstrike; mode, place the year at the"
  33.    PRINT "beginning of the file name. "
  34.    PRINT
  35.    PRINT "-more-"
  36.    pause$ = ""
  37.    DO WHILE pause$ = ""
  38.    pause$ = INKEY$
  39.    LOOP
  40.    CLS
  41.    PRINT "For example: suppose you had the following list contained in APPOINT.APP"
  42.    PRINT : PRINT "                        10088800010020001000"
  43.    PRINT "                        10098811111000000000"
  44.    PRINT : PRINT "Using the editor, change these files to read"
  45.    PRINT : PRINT "                        88100800010020001000"
  46.    PRINT "                        88100911111000000000"
  47.    PRINT : PRINT "Now, go to a copy of your disk and rename all .APP, .NOT,"
  48.    PRINT "and .TD files so that the format follows the sequence:"
  49.    PRINT : PRINT "                         year;month;day.ext"
  50.    PRINT "                      093088.NOT becomes 880930.NOT"
  51.    PRINT : PRINT "If you have trouble converting files, call or write and I will"
  52.    PRINT "help in whatever way I can.          Dave Wilson"
  53.    PRINT "                                     37 Pikehall Pl."
  54.    PRINT "                                     Baltimore, MD 21236"
  55.    PRINT "                                     (301) 529-2009"
  56.    PRINT "Press <SPACE BAR> to begin conversion, any other key to QUIT."
  57.    pause$ = ""
  58.    DO WHILE pause$ = ""
  59.    pause$ = INKEY$
  60.    LOOP
  61.    CLS
  62.    IF pause$ <> CHR$(32) THEN PRINT "FRIDAY conversion program terminated."
  63.  
  64.  
  65. '===================Conversion routine ===================================
  66.  
  67.  
  68. CLS
  69. FOR i = 1 TO 3
  70.    counter = 1
  71.    DO
  72.    SELECT CASE i
  73.       CASE 1
  74.          fil$ = "*.NOT"
  75.          ext$ = ".NOT"
  76.       CASE 2
  77.          fil$ = "*.TD"
  78.          ext$ = ".TD"
  79.       CASE 3
  80.          fil$ = "*.APP"
  81.          ext$ = ".APP"
  82.    END SELECT
  83.    fil$ = fil$ + CHR$(0)
  84.    IF counter = 1 THEN
  85.       CALL findfirstf("a:\" + fil$, attr%, ercd%)
  86.       IF ercd% THEN PRINT "No additional " + ext$ + " files found": PRINT : EXIT DO
  87.    ELSE
  88.       CALL findnextf(ercd%)
  89.       IF ercd% THEN PRINT "No additional " + ext$ + " files found": PRINT : EXIT DO
  90.    END IF
  91.    fil$ = SPACE$(12)
  92.    newfil$ = SPACE$(6) + ext$
  93.    CALL getnamef(fil$, flen%)
  94.    oldfil$ = LEFT$(fil$, flen%)
  95.    IF LEFT$(oldfil$, 8) <> "APPOINTS" AND LEFT$(oldfil$, 7) <> "REOCCUR" AND LEFT$(oldfil$, 8) <> "OLDAPPTS" THEN
  96.       yr$ = MID$(oldfil$, 5, 2): moday$ = LEFT$(oldfil$, 4)
  97.       MID$(newfil$, 1, 2) = yr$: MID$(newfil$, 3, 4) = moday$
  98.       PRINT oldfil$ + " ==> " + newfil$
  99.       SHELL "rename a:" + oldfil$ + " " + newfil$
  100.       counter = counter + 1
  101.    ELSE
  102.    END IF
  103.    LOOP
  104. NEXT i
  105. PRINT : PRINT "Rewriting APPOINTS.APP"
  106. PRINT : PRINT "WARNING:  Do not terminate or data will be lost."
  107. PRINT
  108. CALL exist("a:appoints.app" + CHR$(0), filexists%)
  109. IF filexists% THEN
  110.    OPEN "a:appoints.app" FOR INPUT AS #1
  111.    OPEN "a:temp.$$$" FOR OUTPUT AS #2
  112.    WHILE NOT EOF(1)
  113.       INPUT #1, a$
  114.       PRINT a$ + " => ";
  115.       yr$ = MID$(a$, 5, 2): moday$ = LEFT$(a$, 4)
  116.       MID$(a$, 1, 2) = yr$: MID$(a$, 3, 4) = moday$
  117.       PRINT #2, a$
  118.       PRINT a$
  119.    WEND
  120.    PRINT
  121.    CLOSE 1, 2
  122.    KILL "a:appoints.app"
  123.    SHELL "rename a:temp.$$$ appoints.app>nul"
  124.    PRINT "File conversion successfully completed."
  125.    PRINT
  126. ELSE
  127.    PRINT "APPOINTS.APP not found."
  128.    PRINT
  129. END IF
  130. END
  131.  
  132.  
  133.  
  134.  
  135.  
  136.