NOTE - MAIL SYSTEM NAME AND ADDRESS DELETE PROGRAM
*
erase
set talk off
ACCEPT 'enter by (N)ame or by (R)ecord number' to mode
store !(mode) to mode
IF mode = 'N'
  USE FOGMAIL INDEX NAME
ELSE
  USE FOGMAIL
  ? "Wait a moment while I count the records on file..."
  count TO reccount
  ? "Number of records on file:" + STR(reccount,4)
  accept 'Enter anything to continue...' to mallok
  USE FOGMAIL INDEX NAME
ENDIF
*  - read name and address data
store   '                              ' to mlastname
store  0 to unum
WHILE T
  erase
  IF mode = 'N'
    ACCEPT 'enter last name or space to exit' to mlastname
    store  !(mlastname) to mlastname
    IF mlastname = ' '
      RETURN
    ENDIF
    FIND &MLASTNAME
    IF # = 0
      ?
      ? "   *** NAME NOT ON FILE ***"
      ?
      accept 'Enter anything to continue...' to mallok
    ELSE
      IF *
        ?
        ? "   *** RECORD HAS BEEN DELETED ***"
        ?
        accept 'Enter anything to continue...' to mallok
      ELSE
        DO DELREC
      ENDIF
    ENDIF
  ELSE
    INPUT 'enter record number or 0 to exit' to unum
    IF unum = 0
      RETURN
    ENDIF
    IF unum > reccount
     ?
     ? "   *** NUMBER NOT ON FILE ***"
     ?
     accept 'Enter anything to continue...' to mallok
    ELSE
      GOTO unum
      IF *
       ?
       ? "  *** RECORD HAS BEEN DELETED ***"
       ?
       accept 'Enter anything to continue...' to mallok
      ELSE
        DO DELREC
      ENDIF
    ENDIF
  ENDIF
ENDDO
RETURN

