home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 3 / hamradioversion3.0examsandprograms1992.iso / log / log3_52a / logupdat.prg < prev    next >
Text File  |  1990-05-04  |  4KB  |  149 lines

  1. *:*********************************************************************
  2. *:
  3. *:        Program: LOGUPDAT.PRG
  4. *:
  5. *:         System: PC-HAM Logbook
  6. *:         Author: Joe Kasser G3ZCZ
  7. *:      Copyright (c) 1990, Joe Kasser
  8. *:  Last modified: 05/04/90     11:40
  9. *:
  10. *:      Called by: LOGMISCF.PRG                  
  11. *:
  12. *:           Uses: &LOGBOOK.DBF   
  13. *:
  14. *:        Indexes: &LOGNDX
  15. *:
  16. *:      Documented 05/04/90 at 13:49                SNAP!  version 3.12f
  17. *:*********************************************************************
  18. CLEAR
  19. SET COLOR TO W+/R,W+/RB,BG+
  20. @ 12,28 SAY 'WARNING'
  21. @ 14,14 SAY 'THIS MODULE DOES NOT INVOKE THE INDEX '
  22. @ 16,2 SAY ' USE OF THIS MODULE ON A REGULAR LOG FILE WILL FOUL ITS INDEX'
  23. @ 18,1 SAY 'BE SURE YOU ARE ONLY WORKING WITH A PREVIOUSLY CREATED CONTEST LOG'
  24. SET COLOR TO GR+/B,W+/RB,BG+
  25. @ 20,1 SAY ' '
  26. WAIT
  27. USE &logbook
  28.  
  29. STORE .t. TO callflag
  30.  
  31. GOTO BOTTOM
  32. STORE CALL TO lastcall
  33.  
  34. *INITIALISE NEW VARIABLES
  35. STORE DATE TO ndate
  36. STORE TIME TO ntime
  37. STORE band TO nband
  38. STORE Power TO npower
  39. STORE mode TO nmode
  40. STORE rx TO nrx
  41. STORE tx TO ntx
  42.  
  43.  
  44. *MAIN LOOP
  45. DO WHILE callflag
  46.    CLEAR
  47.    STORE "-" TO nqslsent
  48.    STORE "-" TO nqslrx
  49.    STORE "          " TO ncall
  50.    STORE "          " TO ncomments
  51.    STORE " " TO logflag
  52.    STORE .t. TO dataflag
  53.    @ 4,1 SAY 'NOTE, leave space between number and data in comments if'
  54.    @ 5,1 SAY 'MODE = SSB (eg 59 100)'
  55.    DO WHILE dataflag
  56.       @ 10,1  SAY "LAST CONTACT WAS"
  57.       @ 10,20 SAY lastcall
  58.       @ 12,1  SAY "DATE"
  59.       @ 13,1  SAY "TIME"
  60.       @ 14,1  SAY "CALL"
  61.       @ 15,1  SAY "BAND"
  62.       @ 16,1  SAY "POWER"
  63.       @ 17,1  SAY "MODE"
  64.       @ 18,1  SAY "REPORT (RX)"
  65.       @ 19,1  SAY "REPORT (TX)"
  66.       @ 20,1  SAY "COMMENTS"
  67.       @ 23,1  SAY "Logit (*BL)"
  68.       
  69.       @ 12,13 SAY ndate
  70.       @ 15,13 SAY nband
  71.       @ 16,13 SAY npower
  72.       @ 17,13 SAY nmode
  73.       @ 18,13 SAY nrx
  74.       @ 19,13 SAY ntx
  75.       
  76.       @ 13,13 GET ntime
  77.       @ 14,13 GET ncall
  78.       @ 20,13 GET ncomments
  79.       @ 23,13 GET logflag
  80.       READ
  81.       
  82.       DO CASE
  83.          
  84.       CASE logflag = "*"
  85.          STORE .F. TO callflag
  86.          STORE .F. TO dataflag
  87.          
  88.          
  89.       CASE logflag = "L"
  90.          *LOG ENTRY
  91.          APPEND BLANK
  92.          STORE   .F.          TO   dataflag
  93.          REPLACE qslsent    WITH nqslsent
  94.          REPLACE qslrx      WITH nqslrx
  95.          REPLACE DATE       WITH ndate
  96.          REPLACE TIME       WITH ntime
  97.          REPLACE CALL       WITH ncall
  98.          REPLACE band       WITH nband
  99.          REPLACE Power      WITH npower
  100.          REPLACE mode       WITH nmode
  101.          REPLACE rx         WITH nrx
  102.          REPLACE tx         WITH ntx
  103.          REPLACE comments   WITH ncomments
  104.          STORE CALL         TO   lastcall
  105.          STORE "          " TO   ncall
  106.          STORE "          " TO   ncomments
  107.          
  108.       CASE logflag = 'B'
  109.          @ 15,13 GET nband
  110.       ENDCASE
  111.    ENDDO
  112. ENDDO
  113. * ?
  114. STORE ' ' TO df
  115. ACCEPT 'Is this the last entry in the whole log (Y/N) ?  ' TO df
  116. IF df = 'Y'
  117.    ? 'Formatting the log now,'
  118.    ?
  119.    ACCEPT 'Do you want the contacts numbered ? ' TO df
  120.    STORE 1 TO qsocount
  121.    GOTO TOP
  122.    DO WHILE .not. EOF()
  123.       REPLACE rx WITH SUBSTR(comments,1,3)
  124.       REPLACE comments WITH SUBSTR(comments,4,10)
  125.       IF df = 'Y'
  126.          STORE STR(qsocount,10) TO number
  127.          DO WHILE SUBSTR(number,1,1) = ' '
  128.             STORE SUBSTR(number,2,10) TO number
  129.          ENDDO
  130.          REPLACE comments WITH TRIM(number)+'-'+comments
  131.          STORE qsocount + 1 TO qsocount
  132.       ENDIF
  133.       DISP
  134.       SKIP
  135.    ENDDO
  136.    ?
  137.    ? 'Indexing logbook, please standby'
  138.    SET TALK ON
  139.    INDEX ON CALL+band TO &logndx
  140.    SET TALK OFF
  141. ENDIF
  142. * GET READY TO EXIT
  143. RELEASE df,callflag,lastcall,ndate,ntime,nband,npower
  144. RELEASE nmode,nrx,ntx,nqslsent,nqslrx,ncall,ncomments
  145. RELEASE logflag,dataflag,qsocount,number
  146. USE
  147. RETURN
  148. *: EOF: LOGUPDAT.PRG
  149.