
*          ----------------------------------------------------------------
*          |              LOG.CMD  Version 1.5                            |
*          |       Master .CMD file for HAM RADIO logging program         |
*          |  Written 6/84 by Orbra W. Bliss, Amateur Radio W9GEK / HC1BW |
*          ----------------------------------------------------------------
* Revised 2/3/85 to permit selection of any drive for data files.
*         2/16/85 adding sorting and printout options
* SEVEN files are needed: LOG.CMD 
*                         LOGENTRY.CMD
*                         LOGCHNG.CMD
*                         LOGSERCH.CMD
*                         LOGSORT.CMD
*                         LOGPRINT.CMD
*                         HAMLOG.DBF
*
ERASE
RESET
SET FORMAT TO SCREEN
SET TALK OFF
STORE '        ' TO MFILE, MDATE
STORE ' ' TO MDRV, ACTION
DO WHILE T
  ERASE
  @  2,10  SAY 'HAM RADIO LOG PROGRAM'
  @  6,10  SAY '0) Exit to CP/M'
  @  7,10  SAY '1) Make log entries'
  @  8,10  SAY '2) Search a file'
  @  9,10  SAY '3) Index a file on any field'
  @ 10,10  SAY '4) Edit a file'
  @ 11,10  SAY '5) Printout a file'
  @ 12,10  SAY '6) Exit to dBASE'
  @ 18,10  SAY 'On which Drive are the data files ?' GET MDRV PICTURE 'A'
  @ 15,10 SAY 'Enter number of desired action' GET ACTION PICTURE '9'
  READ

  IF ACTION= '0'
     ERASE
     QUIT
  ENDIF action 0

  IF ACTION= '1'
     ERASE
     @  6,10 SAY '1) Make entries into an old file'
     @  8,10 SAY '2) Start a new file'
     @ 11,10 SAY 'Enter number of desired action'
     WAIT TO CHOICE
     IF CHOICE= '1'
        ERASE
        LIST FILES ON &MDRV
        @ 15,5  SAY 'Enter name of data file to be used.' GET MFILE
        READ
        USE &MDRV.:&MFILE
        DO LOGENTRY
     ENDIF choice 1
     IF CHOICE= '2'
        ERASE
        @ 10,10  SAY 'What is the name of the new file?' GET MFILE
        READ
        STORE TRIM(MFILE) TO MFILE
        USE &MDRV.:HAMLOG
        COPY STRUCTURE TO &MDRV.:&MFILE
        USE &MDRV.:&MFILE
        DO LOGENTRY
     ENDIF choice 2
  ENDIF action 1

  IF ACTION= '2'
     DO LOGSERCH
  ENDIF action 2

  IF ACTION= '3'
        DO LOGSORT
  ENDIF action 3

  IF ACTION= '4'
     ERASE
     LIST FILES ON &MDRV
     @ 15,5  SAY 'Enter name of data file to be used.' GET MFILE
     READ
     USE &MDRV.:&MFILE
     STORE ' ' TO RECNUM
     DO WHILE RECNUM # 0
        ERASE
        @ 15,5  SAY 'Enter number of record to be changed.' GET RECNUM
        READ
        STORE &RECNUM TO RECNUM
        DO LOGCHNG
     ENDDO recnum # 0
  ENDIF action 4

  IF ACTION= '5'
     ERASE
     LIST FILES ON &MDRV
     STORE ' ' TO MDSK
     @ 12,5  SAY 'Enter name of data file to be used.' GET MFILE
     @ 15,5  SAY 'Should this be written to a disk file? ' GET MDSK
     READ
     IF !(MDSK)= 'Y'
        STORE '          ' TO LOGPRNT
        @ 19,12 SAY '(A different drive may be specified.)'
        @ 18,5  SAY 'What is the name of the disk file?'  GET LOGPRNT
        READ
     ENDIF mdsk='y'
     USE &MDRV.:&MFILE
     DO LOGPRINT
  ENDIF action 5

  IF ACTION= '6'
     USE
     RETURN
  ENDIF action 6

ENDDO while t
SET TALK ON
RETURN
LOGPRINT
  ENDIF action 5

  IF ACTI