home *** CD-ROM | disk | FTP | other *** search
/ The Best of the Best / _.img / 02192 / logbook.arc / LOG2DBF.PRG < prev    next >
Text File  |  1987-12-24  |  3KB  |  97 lines

  1. *LOG2DBF CONVERTS A BASIC LOG FILE TO A DATABASE VERSION 851114
  2. * Modified 871120
  3. STORE 'LOG' TO log
  4. IF FILE (log + '.DBF')
  5.    USE &log
  6.    * EMPTY LOG FILE
  7.  
  8.    STORE ' ' TO contestlog
  9.    ACCEPT 'What is the name of the contest log (D:NAME) ' TO contestlog
  10.    IF FILE (contestlog + '.DBF')
  11.       ? 'ERROR,',contestlog,' ALREADY EXISTS'
  12.       WAIT
  13.    ELSE
  14.       IF FILE (contestlog+'.LOG')
  15.          COPY STRUCTURE TO &contestlog
  16.          ?
  17.          ? ' New database file created'
  18.          USE &contestlog
  19.          STORE TRIM(contestlog) + '.LOG' TO oldlog
  20.          ?
  21.          ? 'Copying log data now'
  22.          SET TALK ON
  23.          APPEND  FROM &oldlog DELIM
  24.          SET TALK OFF
  25.          STORE ' ' TO df
  26.          ACCEPT ' Do you want a listing of the database (Y/N) ? ' TO df
  27.          IF UPPER(df) = 'Y'
  28.             LIST
  29.             ?
  30.          ENDIF
  31.          ?
  32.  
  33.          ACCEPT 'Do you want the contacts numbered (Y/N) ? ' TO df
  34.          IF UPPER(df) = 'Y'
  35.             STORE 1 TO qsocount
  36.             GOTO TOP
  37.             DO WHILE .NOT. EOF()
  38.                REPLACE rx WITH SUBSTR(comments,1,3)
  39.                REPLACE comments WITH SUBSTR(comments,4,10)
  40.                IF UPPER(df) = 'Y'
  41.                   STORE STR(qsocount,10) TO number
  42.                   DO WHILE SUBSTR(number,1,1) = ' '
  43.                      STORE SUBSTR(number,2,10) TO number
  44.                   ENDDO
  45.                   REPLACE comments WITH TRIM(number)+'-'+comments
  46.                   STORE qsocount + 1 TO qsocount
  47.                ENDIF
  48.                DISP
  49.                SKIP
  50.             ENDDO
  51.          ENDIF
  52.  
  53.          ACCEPT 'Do you want to INDEX the contest log (DBF) (Y/N) ? ' TO df
  54.          IF UPPER(df) = 'Y'
  55.             ?
  56.             USE &contestlog
  57.             SET TALK ON
  58.             INDEX ON call+band TO &contestlog
  59.             SET TALK OFF
  60.             ? 'TO PRINT CONTEST LOG, go back to main menu'
  61.             ?
  62.             ? 'SET LOG TO contestlog, AND PRINT IT'
  63.             WAIT
  64.          ENDIF
  65.  
  66.          ACCEPT 'Append the new log to the main logbook (Y/N) ? ' TO df
  67.          IF UPPER(df) = 'Y'
  68.             ?
  69.             IF FILE (logbook + '.DBF')
  70.                USE &logbook INDEX &logndx
  71.                SET TALK ON
  72.                APPEND FROM &contestlog 
  73.                SET TALK OFF
  74.             ELSE
  75.                ? 'ERROR,',logbook,' IS NOT ON DEFAULT DRIVE'
  76.                WAIT
  77.             ENDIF
  78.          ENDIF
  79.  
  80.          ACCEPT 'Do you want to make the contest log the default log ? ' TO df
  81.          IF UPPER(df) = 'Y'
  82.             STORE contestlog TO logbook
  83.             STORE contestlog TO logndx
  84.          ENDIF
  85.       ELSE
  86.          ? 'ERROR CONTEST LOG IS NOT ON DEFAULT DRIVE'
  87.          WAIT
  88.       ENDIF
  89.    ENDIF
  90. ELSE
  91.    ? 'BLANK LOG IS NOT ON DEFAULT DRIVE'
  92.    WAIT
  93. ENDIF
  94. RELEASE oldlog,df,contestlog,log
  95. USE
  96. RETURN
  97.