1 SUB M11RMV (FUNC$, F.END%) & 2 !******************************************************************** & ! & ! & ! M11RMV & ! & ! Removes addresses from the Mailing List & ! & ! & !******************************************************************** & ! 3 ! Subprogram : M11RMV & ! Version : 1 & ! Programmer : John Montrym & ! Jean Fullerton & ! Releaser : & ! 11 !-------------------------------------------------------------------- & ! & ! & ! C O P Y R I G H T & ! & ! & !-------------------------------------------------------------------- 100 ! & ! & ! & ! Summary: & ! & ! This subprogram is the Smart Mailer remove module. & ! & ! notes for future enhancements: & ! Allow changes to a user-defined Primary ID (12160) & ! & ! & ! Calling Module: SMAIL & !-------------------------------------------------------------------- 200 ! & ! & ! Interfaces: & ! & ! & ! 300 !-------------------------------------------------------------------- & ! & ! & ! Input / Output & ! & ! & ! & ! CHANNEL FILE NAME MAP NAME STATUS AT ENTRY/EXIT & ! ------- --------- -------- -------------------- & ! CH.KB User keyboard None Closed/Closed & ! CH.ADD Address file MAPADD Closed/Closed & ! CH.SCR Screen file None Closed/Closed & ! & ! 400 !-------------------------------------------------------------------- & ! & ! & ! Variables and Arrays & ! & ! & ! & ! ERL Line in which error occurred & ! ERR Set to error after error & ! 600 !******************************************************************** & ! & ! & ! Common Declarations & ! & ! & !******************************************************************** & & 650 !******************************************************************** & ! & ! & ! MAP Statements & ! & ! & !******************************************************************** & & 700 !-------------------------------------------------------------------- & ! & ! & ! Subprograms & ! & ! & ! M11PAK Packs a record for writing to mailing list file & ! M11UPK Unpacks a record from mailing list file & ! & ! M11SCD Displays a screen & ! M11SCR Reads input from user keyboard & ! M11SCW Writes text at specififed coordinates & ! & ! 800 !-------------------------------------------------------------------- & ! & ! Subroutines: & ! & ! & ! 11000 Displays all prompts & ! 13000 Displays the data from the & ! record in MAPADD & ! & !-------------------------------------------------------------------- & ! & ! Functions: & ! & ! & !-------------------------------------------------------------------- & 1000 !******************************************************************** & ! & ! & ! S T A R T S U B P R O G R A M L O G I C & ! & ! & !******************************************************************** & 1010 ON ERROR GOTO 19000 & \ ERR.CALLNAM$ = ERR.PROGNAM$ & \ ERR.PROGNAM$ = "M11RMV VER:01" & \ ERR.SUBNAM$ = "" & \ ERR.MSG$ = "Unexpected fatal error." & ! Set standard error trap. & ! Set up common for error reporting. & 1020 FUNC.DPY$ = "Remove" & ! Set up the function name. 2000 !-------------------------------------------------------------------- & ! & ! & ! Remove & ! & ! & !-------------------------------------------------------------------- & & CALL M11SCD (SCR.REMOVE.ADDR%) & ! Ask the user to specify a Primary ID. & 2050 CALL M11SCR (ANS$, 13%, 25%, 16%, "", "A", F.END%) & \ GO TO 9000 IF F.END% & \ GO TO 2050 IF ANS$ = "" & \ IF HDR.SYS.DEF.PRIME.ID$ = "Y" OR HDR.SYS.DEF.PRIME.ID$ = "1" & THEN RSET ADD.PRIME.ID$ = ANS$ & ELSE LSET ADD.PRIME.ID$ = ANS$ & ! Get the Primary ID for the delete. & 2080 GET #CH.ADD%, KEY #0% EQ ADD.PRIME.ID$ & ! Try to get. Error traps to 2200. & 2100 MOVE FROM #CH.ADD%, REC$ = RECOUNT & \ CALL M11UPK (REC$) & \ POINTER% = 20% & \ GO SUB 13000 & ! Unpack the address and display it on the screen. & 2120 CALL M11SCW ("Type REMOVE to delete this address:", 24%, 1%) & \ CALL M11SCR (ANS$, 24%, 38%, 6%, "", "A", F.END%) & \ GO TO 2000 IF F.END% & \ IF ANS$ = "REMOVE" THEN DELETE #CH.ADD% & \ GOSUB 14200 ! Decrement MLF total & \ M11.MSG$ = "Address has been removed." & ELSE M11.MSG$ = "Address has NOT been removed." + BEL + BEL & \ UNLOCK #CH.ADD% & ! Perform the delete function. If the user chooses not to delete, & ! then unlock the record. 2140 GO SUB 14800 & \ GO TO 2000 & ! Notify the user and return for another remove request. & & 2200 CALL M11SCW ("That address does not exist." + BEL, 24%, 1%) & \ GO TO 2050 & ! Address does not exist. & 2220 CALL M11SCW ("Another user is using that address. Please try later.", 24%, 1%) & \ GO TO 2050 & ! Tell the user that someone else has the record. & 9000 !******************************************************************** & ! & ! & ! E N D O F P R O C E S S I N G & ! & ! & !******************************************************************** & & ERR.PROGNAM$ = ERR.CALLNAM$ & \ UNLOCK #CH.ADD% & \ GO TO 32767 & ! Jump around the junk and leave. & & & 10000 !******************************************************************** & ! & ! & ! Local Subroutines & ! & ! & !******************************************************************** & 11000 !-------------------------------------------------------------------- & ! & ! & ! Display Address Prompts & ! & ! & !-------------------------------------------------------------------- & 11010 CALL M11SCD (SCR.ADDR.ENTRY%) & \ CALL M11SCW (FUNC.DPY$, 1%, 2%) & \ CALL M11SCW (HDR.CAT.PROMPT$(I%), 10%+I%, 5%) FOR I% = 1% TO 6% & \ REDISPLAY% = FALSE% & \ RETURN & ! Put up the screen of questions. We must fill in the custom stuff. & & 11300 !-------------------------------------------------------------------- & ! & ! & ! Offer Help & ! & ! & !-------------------------------------------------------------------- & & CALL M11SCD (SCR.HLP.7A%) & \ CALL M11SCR (ANS$, 24%, 72%, 4%, "", "A", F.END%) & \ RETURN UNLESS SEG$ (ANS$, 1%, 1%) = "M" & ! Show help screen, return if this is sufficient. & 11320 CALL M11SCD (SCR.HLP.7B%) & \ M11.MSG$ = "When through reading the information ..." & \ GO SUB 14900 & \ RETURN & ! Display the last screen and return. & 13000 !-------------------------------------------------------------------- & ! & ! & ! Display an Address & ! & ! input: POINTER% & ! ADD.- & ! FUNC$ & ! & !-------------------------------------------------------------------- & 13020 GO SUB 11000 ! Put up prompts. & & \ CALL M11SCW (ADD.ADDR$(I%), 3%+I%, 24%) FOR I% = 0% TO 4% & \ CALL M11SCW (ADD.STATE$, 8%, 24%) & \ CALL M11SCW (ADD.ZIP$, 9%, 24%) & \ CALL M11SCW (ADD.CATEGORIES$(I%), 11%+I%, 24%) FOR I% = 0% TO 5% & \ CALL M11SCW (NUM1$(ADD.COUNTER%), 17%, 24%) & \ CALL M11SCW (ADD.COMMENT$, 18%, 15%) & \ PRIME.ID$ = EDIT$ (ADD.PRIME.ID$, 8%) & \ CALL M11SCW (PRIME.ID$, 20%, 24%) & \ CALL M11SCW (ADD.ALTERNATE.ID$, 21%, 24%) & \ CALL M11SCW ("<--- selected by", POINTER%, 45%) UNLESS FUNC$ = "A" & ! Display all the prompts. Then display all the data. & 13040 RETURN & & 14000 !---------------------------------------------------------------------& ! & ! Update Total in File Header & ! & !--------------------------------------------------------------------- 14100 GET #CH.ADD%, KEY #0% EQ HDR.CHR$ IF MLF_TOTAL_FLAG$ = CHR$(1%) THEN MLF_TOTAL = MLF_TOTAL + 1 UPDATE #CH.ADD% END IF RETURN ! A record has been added to the file. Update the total ! in the file header. Note: Smart Mailer V1.0 did not store ! the total in the file header, so these fields may be blank. ! M11RP1 initializes these fields if necessary. 14200 GET #CH.ADD%, KEY #0% EQ HDR.CHR$ IF MLF_TOTAL_FLAG$ = CHR$(1%) THEN MLF_TOTAL = MLF_TOTAL - 1 UPDATE #CH.ADD% END IF RETURN ! A record has been removed from the file. Update the total ! in the file header. Note: Smart Mailer V1.0 did not store ! the total in the file header, so these fields may be blank. ! M11RP1 initializes these fields if necessary. 15000 !*************************************************************** & ! & ! & ! F U N C T I O N S L O C A L T O & ! & ! T H I S S U B P R O G R A M & ! & ! & !*************************************************************** & 19000 !*************************************************************** & ! & ! & ! S T A N D A R D E R R O R H A N D L I N G & ! & ! & !*************************************************************** & 19010 GO TO 19990 IF ERN$ <> SEG$ (ERR.PROGNAM$,1%,6%) & ! Only tracing back an error from another subprogram. & 19100 RESUME 2220 IF ERL = 2080 AND ERR = 154 & \ RESUME 2200 IF ERL = 2080 AND (ERR = 155 OR ERR = 11) & \ RESUME 14100 IF ERR = 14100 AND ERR = 154 & \ RESUME 14200 IF ERR = 14200 AND ERR = 154 & ! Errors which can be handled logically. & 19900 ERR.ERL% = ERL & \ ERR.ERR% = ERR & \ ERR.CODE% = FATAL.ERROR% & 19990 ON ERROR GO BACK & ! Return to calling program for fatal error processing. & 32767 SUBEND