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

  1. *LOGADD VERSION 871209 CALLED FROM LOGBOOK
  2. * (c) COPYRIGHT JOE KASSER G3ZCZ 1986
  3. * IF YOU CHANGE THE STRUCTURE OF THE DATABASE TO INCREASE THE
  4. *WIDTH OF THE COMMENTS, MODIFY THE PROGRAM AS SHOWN BELOW
  5.  
  6. ACCEPT 'Are you running this in real TIME (Y/N) ? ' to rtf
  7. IF rtf = 'Y'
  8.    STORE '9999' TO otime
  9.    STORE ' ' TO dummy
  10. ENDIF
  11.  
  12. USE &logbook
  13. STORE .T. TO callflag
  14. GOTO BOTTOM
  15. STORE call TO lastcall
  16. STORE RECNO() TO lastentry
  17.  
  18. *initialise new variables
  19. STORE date TO ndate
  20. STORE TIME TO ntime
  21. STORE band TO nband
  22. STORE power TO npower
  23. STORE mode TO nmode
  24. STORE rx TO nrx
  25. STORE tx TO ntx
  26.  
  27. SET INDEX TO &logndx
  28. CLEAR
  29. *MAIN LOOP
  30. DO WHILE callflag
  31.    STORE "-" TO nqslsent
  32.    STORE "-" TO nqslrx
  33.    STORE "          " TO ncall
  34. * CHANGE THE LENGTH OF THE SPACES BETWEEN THE " " ON THE NEXT LINE
  35. * IF YOU CHANGE THE WIDTH OF THE COMMENTS here it is set to 10
  36.    STORE "          " TO ncomments
  37.    STORE " " TO logflag
  38.    STORE .T. TO dataflag
  39.  
  40.    DO WHILE dataflag
  41.       IF rtf = 'Y'
  42. *        DO REALTIME
  43.          ntime = time()
  44.          ndate = dtoc(date())
  45.          ndate = substr(ndate,7, 2) + '/' + substr(ndate,1,5)
  46.          ntime = substr(ntime,1,2) + substr(ntime,4,2)
  47.       ENDIF
  48.       @ 19,1  SAY lastentry
  49.       @ 19,12 SAY "LAST CONTACT WAS WITH "
  50.       @ 19,35 SAY lastcall
  51.  
  52.       @ 21,3  SAY "DATE"
  53.       @ 21,11 SAY "TIME"
  54.       @ 21,19 SAY "CALL"
  55.       @ 21,26 SAY "BAND"
  56.       @ 21,31 SAY "PWR"
  57.       @ 21,36 SAY "MODE"
  58.       @ 21,41 SAY "RX"
  59.       @ 21,45 SAY "TX"
  60.       @ 21,49 SAY "S"
  61.       @ 21,51 SAY "R"
  62.       @ 21,55 SAY "COMMENTS"
  63.       @ 23,1  SAY "QRU (*TPHL)"
  64.  
  65.       IF logflag <> 'T'
  66.          @ 22,1  GET ndate
  67.          @ 22,11 GET ntime
  68.          @ 22,16 GET ncall
  69.          @ 22,27 GET nband
  70.          @ 22,31 GET npower
  71.          @ 22,36 GET nmode
  72.          @ 22,41 GET nrx
  73.          @ 22,45 GET ntx
  74.          @ 22,49 GET nqslsent
  75.          @ 22,51 GET nqslrx
  76.          @ 22,53 GET ncomments
  77.       ENDIF
  78.  
  79.          @ 23,13 GET logflag
  80.          READ
  81.  
  82.       DO CASE
  83.          CASE logflag = 'H'
  84.             GOTO TOP
  85.             STORE 1 TO linecount
  86.             STORE TRIM(ncall) TO fcall
  87.             FIND &fcall
  88.             IF (EOF() .OR. BOF())
  89.                CLEAR
  90.                @ 5,1 SAY ncall
  91.                @ 5,12 SAY "Does not appear to be in the log"
  92.                WAIT
  93.                CLEAR
  94.             ELSE
  95.                DO WHILE  CALL = fcall .AND. (.NOT. EOF())
  96.                   IF linecount = 1
  97.                      CLEAR
  98.                      @ 1,10 SAY "PREVIOUS LOG ENTRIES ARE "
  99.                   ENDIF
  100.                   ? RECNO(),date,TIME,call,band,tx,rx,mode,power
  101.                   ?? qslsent,qslrx,comments
  102.                   STORE linecount + 1 TO linecount
  103.                   IF linecount = 20
  104.                      ?
  105.                      WAIT
  106.                      STORE 1 TO linecount
  107.                   ENDIF
  108.                   SKIP
  109.                ENDDO
  110.                ?
  111.                WAIT
  112.                IF linecount > 16
  113.                   CLEAR
  114.                ENDIF
  115.             ENDIF
  116.          CASE  logflag = 'L' .OR. logflag = 'P'
  117.             IF logflag = 'L'
  118.                *LOG ENTRY
  119.                APPEND BLANK
  120.                STORE .F. TO dataflag
  121.                REPLACE qslsent WITH nqslsent
  122.                REPLACE qslrx WITH nqslrx
  123.                REPLACE date WITH ndate
  124.                REPLACE TIME WITH ntime
  125.                REPLACE call WITH ncall
  126.                REPLACE band WITH nband
  127.                REPLACE power WITH npower
  128.                REPLACE mode WITH nmode
  129.                REPLACE rx WITH nrx
  130.                REPLACE tx WITH ntx
  131.                REPLACE comments WITH ncomments
  132.                STORE call TO lastcall
  133.                STORE RECNO() TO lastentry
  134.                STORE "          " TO ncall
  135.                STORE "          " TO ncomments
  136.             ENDIF
  137.             IF   logflag = 'P' .OR. logflag = 'L'
  138.                USE &logbook
  139.                GOTO BOTTOM
  140.                SKIP -12
  141.                CLEAR
  142.                @ 1,1  SAY '12 ENTRIES BEFORE'
  143.                @ 1,20 SAY lastcall
  144.                @ 1,30 SAY ' IN LOG, ARE'
  145.                ?
  146.                DO WHILE .NOT. EOF()
  147.                   ? RECNO(),date,time,call,band,tx,rx,mode
  148.                   ?? power,qslsent,qslrx,comments
  149.                   SKIP
  150.                ENDDO
  151.                SET INDEX TO &logndx
  152.             ENDIF
  153.  
  154.          CASE logflag = "*"
  155.             STORE .F. TO callflag
  156.             STORE .F. TO dataflag
  157.  
  158.          CASE logflag = 'T'
  159.            IF rtf = 'Y'
  160.                ndate = dtoc(date())
  161.                ndate = substr(ndate,7, 2) + '/' + substr(ndate,1,5)
  162.                ntime = time()
  163.                ntime = substr(ntime,1,2) + substr(ntime,4,2)
  164.           ENDIF
  165.            @ 22,1 SAY ndate
  166.            @ 22,11 SAY ntime
  167.       ENDCASE
  168.    ENDDO
  169. ENDDO
  170. USE
  171. * GET READY TO EXIT
  172. RELEASE lastcall,lastentry,ndate,ntime,ncall,nband,npower,nmode
  173. RELEASE nqslsent,nqslrx,nrx,ntx,ncomments,fcall,linecount,fdate
  174. RELEASE otime,rtf,mtime,cpointer,dummy,hour,min,mm,dd,yy,ndate
  175. RELEASE callflag,dataflag,logflag
  176. RETURN
  177.