home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1990-01-31 | 26.0 KB | 1,117 lines
SBP ╜ ********************************************************************** ╜ *** Created by: Mark C. Johnson ╜ *** Additional Design: Dan P. Browning, Simon Tranmer ╜ *** on: Aug, 1989 ╜ *** Text mods by BH 15-8-89 ╜ *** ╜ *** This is meant to be a functional mail base application ╜ *** both to use and to learn from. Please be advised that, while all of ╜ *** these commands do work, they may not live up to the full ╜ *** capabilities of a $$$ mailing program. Still, I think this ╜ *** program shows off many of the capabilities and ╜ *** possibilities of this database package. Hopefully, you will be ╜ *** happy with the functions contained herein, if not, feel free to ╜ *** mangle and otherwise experiment. What use is a demo, if it can't ╜ *** be changed? One word of warning, though: this is a rather ╜ *** intricately involved package. Many of the functions use variables ╜ *** set up somewhere else. The forms themselves often have functional ╜ *** pieces not easily ascertained by just looking at the form itself. ╜ *** Before you go making giant leaping strides, I suggest you back up ╜ *** all the forms, etc. so you have a base to go back to if something ╜ *** does not quite come out right. ╜ *** ╜ *** This program and all its related sections are considered in the ╜ *** public domain as long as no section or program segment of this ╜ *** code is sold for financial gain. Permission for using sections ╜ *** of this code inside of applications for the express intention ╜ *** of being sold may be obtained by writing to: ╜ *** ╜ *** Precision Inc. ╜ *** ATTN: Applications Department ╜ *** 8404A Sterling Street ╜ *** Irving, TX 75063 USA ╜ *** ╜ *** or by the corresponding address in England: ╜ *** ╜ *** Precision Software Ltd. ╜ *** 6 Park Terrace ╜ *** Worcester Park, Surrey ╜ *** KT4 7JZ England ╜ *** ╜ ************************************************************************ ╜ ** Config routine. This reads in our old variables, sets up our error detection, and presets ╜ variables used on the form. │ _ wErrtrap ╫prs%(5,5),a$(3),e$(3),c$(3),c%(3) Γ e ╩ ╦"Setting up..." ╩"MDEFAULT" pth$ Ä activity$ "" ┤ £"Mailit" ¼1,1,1,"&Add to Mailing List" ¼1,2,1,"&Merge Lists " ¼1,3,1,"&Edit Mailing List " ¼1,4,1,"Print &Labels " ¼1,5,1,"&Utilities " ¼1,6,1,"&Purge Duplicates " ¼1,7,1,"Set &Options " ¼1,8,1,"&Help " ¼1,9,1,"&Quit " MainMenu: ╜ ** Main Menu - This is the routine we use to set up our system wide ╜ commands menu. It checks for keyboard presses, mouse clicks, and ╜ the selection of the menu bar. It also sets up the form and other ╜ Nicities. badd$ "Add to Mailing List" bEdit$ "Edit Mailing List" bLabel$ "Print Labels" bMerge$ "Merge Lists" bUtil$ "Utilities" bPurge$ "Purge Duplicates" bOption$ "Set Options" bHelp$ "Help" bQuit$ "Quit" ╩ σ Ñ e ╩ ╦"Click, Type, or Select Menu Command." activity$ "" Äpth$ £2 Ñ1,"!GOTO Helpme" ╩ ƒ"Microsoft Mailing List System" ¼1,0,1,"&Commands" ¼ │clm%,sel% Γ e ccr% 0:cc% 0:ent% 0:a$ "":ret% 0:helpsel% 0:zr% 0 sel% 0:a$ "":srtn% 0 ╧ ¼ Ñ ▀ MM1: ╜ ** This routine actually takes the selection and finds out where the ╜ user wanted to go. ¼1,0,0," " │sel% wAddEnts,MergeEnts,EditEnts,PrintLabs,Utilities,PurgeEnts,SetOpts,Helpme,Quitit ╜ ** If we get to here, the user must have pressed a key or clicked on an area that is not a button ¥a$ vFlushBuffer a$ >(a$) ╔ µa$ µ"A" sel% 1: ╜ was it the Add command? µ"M" sel% 2: ╜ Merge? µ"E" sel% 3: ╜ Edit? µ"L" sel% 4: ╜ Labels µ"U" sel% 5: ╜ Utilities µ"P" sel% 6: ╜ Purge µ"O" sel% 7: ╜ Options µ"H","?" sel% 8: ╜ Help(!) µ"Q", (27) sel% 9: ╜ Get outta dodge? µ ^ sel% 0: ╜ Wasn't any key I know about, let's ignore it. Æ ╔ ╜ A briefer alternative to the above CASE structure is: ╜ sel% = INSTR ("AMELUPOHQ",a$) ísel% wMM1 wMainMenu AddEnts: ╜ ** Add set up area ret% 9:helpsel% 1 ╩ σ Ñ │ Ñ1,"!activity$=~~:open form ~Mailit~:GOTO H1" ╩ ƒ"Add to Mailing List" activity$ "Data Entry Form" ┤ £"AddForm" ╩ ╦"ESC=Stop | SHIFT+TAB=Previous Field | Shift+F1=Help" AE1: ╜ ** Actual guts of the Add routine. Checks for a blank form for an end-of-entry ü £ Country "USA" ╬ ▀ │ ö1,0 íFirstName "" LastName "" Company "" pactivity$ "": ┤ £"Mailit": wMainMenu ╠ £ wAE1 MergeEnts: ╜ ** Merge front end - The prg% variable is used to distinguish whether we are merging (0), or purging (9) £6 ╩ ╦"Merge Databases..." ret% 9:helpsel% 2 Ñ1,"!GOTO H1" merl% 4:automan% 1 ╩ ƒ"Merge Entries" bModify$ "Set Thresholds" bHelp$ "Help" bCancel$ "Cancel Merge" bOK$ "Begin Merge" prg% 0 wMEBegin PurgeEnts: ╜ ** Purge front end £6 ╩ ╦"Purge Databases..." ret% 9:helpsel% 6 Ñ1,"!GOTO H1" merl% 1:automan% 1 ╩ ƒ"Purge Entries" bModify$ "Set Thresholds" bHelp$ "Help" bCancel$ "Cancel Purge" bOK$ "Begin Purge" prg% 9 MEBegin: ╩ ╦"ESC=Stop | B=Begin | T=Set Thresholds" cnt% 0 wME21 ME1: ╜ ** Wait for entry then see if it was a mouse click ╬ cnt% 0:a$ "" ╧ Ñ ▀ ¥a$ vFlushBuffer ía$ "" wME2 ícnt% 0 wH1 ícnt% 50 wMainMenu ícnt% 999 wMChangePreset ícnt% 0 wME21 wME3 ME2: ╜ ** Check what key was pressed z% 0(a$) íz% 0 pz% merl% a$ >(a$) ╔ µa$ µ"H","?" wH1 µ"C", (27) wMainMenu µ"V" automan% 2: wME21 µ"M" automan% 1: wME21 µ"O" automan% 3: wME21 µ"T" wMChangePreset µ"B" wME3 µ ^ íz% 5 wME1 merl% z% Æ ╔ ME21: ╜ ** Set preset levels from pre-defined array prs1% prs%(merl%,1) prs2% prs%(merl%,2) prs3% prs%(merl%,3) prs4% prs%(merl%,4) prs5% prs%(merl%,5) wME1 MChangePreset: ╜ ** Modify Preset levels and then store them ö1,5 prs%(merl%,1) prs1% prs%(merl%,2) prs2% prs%(merl%,3) prs3% prs%(merl%,4) prs4% prs%(merl%,5) prs5% ┤"mdefault" ¢ ╢ { ½ å ╢ wME21 ME3: ╜ ** Set up routine for the Find Duplications routine. This routine ╜ sets up the forms, then checks to see if the file is in a proper ╜ format (if its a merge), and imports it. íprg% 0 pst$ "Importing":st1$ "Import" ^st$ "Purging Section of":st1$ "Purge" R% A("MailBase") íprg% 0 p ╩ ╦"Importing file..." ┬"File to import:","",11,n%,fln$ ín% 0 wMergeEnts í J(fln$ ".sbf") 0 p ┬"Cannot find file ",fln$ ".sbf",21,n%: wMergeEnts bModify$ "Importing...":bHelp$ "Importing...":bCancel$ "Importing...":bOK$ "Importing..." ╬ xFieldNameData z1% 0 ┤fln$ ".sbd" ¢ ñ I1: ╝b$ ñ ca$ í -(a$,1) ">" pz1% 9 a$ F( +(a$,15)) í >(a$) >(b$) wNoWay íb$ "Misc2" wOKDokey íz1% pz1% 0: ñ ca$ wI1 NoWay: å ñ ┬"This file does not match the MailBase","parameters. Re-configure and try again.",114,n% wMainMenu OKDokey: å ñ ófln$ ".sbf" q Ö"MailBase" Æ í ╜ ** Now we check to see if they want to standardize the mail base. ╜ If they do, the chances for finding duplicates increases due to ╜ the fact that there will be less confusion over whether Ave and ╜ Avenue are the same thing. íprg% 0 p srtn% 9 ┬"Do You Wish to Standardize the Database First?","",130,n% ín% 0 psrtn% 0: wBeg vBegStand srtn% 0 Æ í Beg: ╜ ** Now we actually jump out to the FindDupes routine and close out ╜ after we are done, showing the total number of changed records ╜ and so on. md% A("MailBase") vFindDupes í(prs1% prs2% prs3% prs4% prs5% 0) prg% p ╔ ╛ Ö"MailBase" fl% A("MailBase") activity$ st1$ " complete" (13) activity$ activity$ "Initial Record Count was " H( (R%,5,0)) "," (13) íprg% 0 p activity$ activity$ H( (md% R%,5,0)) " Records Imported" (13) Æ í activity$ activity$ H( (md% fl%,5,0)) " Records Purged" (13) activity$ activity$ H( (fl%,5,0)) " Records Remaining" (13) £1 ╩ ╦"Press any key to continue..." ╧ Ña$ wMainMenu FindDupes: ╜ ** this is the heart of the Merge/Purge routines as it actually finds ╜ any duplications and handles them according to what the user ╜ user wishes. íprg% 0 (prs1% prs2% prs3% prs4% prs5% 0) p ├ íprg% (prs1% prs2% prs3% prs4% prs5% 0) p ┬"WARNING! All thresholds are currently set to zero, this","will delete all records in the file. Proceed?",148,n% ín% 0 wPurgeEnts ┬"Are you sure?","",135,n% ín% 0 wPurgeEnts Æ í ╩ ╦"Removing current index..." Ö"MailBase" │ _ wNoIndex úVirField.MailBase ╛ úVirField.MailBase wGoOn NoIndex: yGoOn Æ GoOn: │ _ wErrtrap crit$ "LEFT$(Zip.MailBase," H( (prs%(merl%,5),2,0)) ")+LEFT$(lastname.Mailbase," H( (prs%(merl%,1),2,0)) ")+left$(Address1.MailBase," H( (prs%(merl%,2),2,0)) ")+left$(company.MailBase," crit$ crit$ H( (prs%(merl%,3),2,0)) ")+left$(City.MailBase," H( (prs%(merl%,4),2,0)) ")" ╩ ╦"Creating Index..." ísrtn% psrtn% 0: £5 bModify$ "Wait..." bHelp$ "Wait..." bCancel$ "Wait..." bOK$ "Wait..." ╬ «VirField.MailBase,"VirField;VTX CLC RDO;50;14;0",crit$ ë ú │VirField.MailBase ╜ ** at this time, we have our virtual field set up, and are going to ╜ actually start checking for duplicates via the very handy ╜ SELECT DUPLICATE command. Ö"MailBase" íautoman% 3 p £5 ^ activity$ "Wait, " st$ " database...": £1 Æ í ╩ ╦st$ " database..." bKeep$ "Keep":bDelete$ "Delete":bRplace$ "Replace" íautoman% 1 pbKeep$ "Auto Mode":bDelete$ "Auto Mode":bRplace$ "Auto Mode" íautoman% 2 pbDelete$ "Searching..." ╔ ` recproc% 0 numdups% 0 FD1: ╜ ** this routine is the actual loop that runs through every record in the database ╜ searching for duplicates. ¥ink$ íink$ (27) ink$ "C" p ├ a10$ VirField.MailBase recproc% recproc% 1 íautoman% 3 p íautoman% 2 pbDelete$ "Searching..." a1$ FirstName.MailBase a2$ LastName.MailBase a3$ Company.MailBase a4$ Address1.MailBase a5$ Address2.MailBase a6$ City.MailBase a7$ State.MailBase a8$ Zip.MailBase a9$ (Entered.MailBase,"mm/dd/yyyy") a11$ "" ü £: ╬: ╔ Y Æ í FD2: ╜ ** The screen is set up, and we have our current index. Now, is ╜ there any duplicates? ╔ ] í B("MailBase") p ╔ ▒ Ö"MailBase" í B("MailBase") p ├ wFD1 ^ íautoman% 2 p numdups% numdups% 1 a11$ VirField.MailBase ╬ bCmd% 0 MF1: ╜ ** We have found a duplicate and the user has selected ╜ the manual mode, so we set up our display and allow ╜ them to select whether to delete, etc. ╩ ╦"ESC=Stop | D=Delete | K=Keep | R=Replace" ╧ Ñ ▀ íbCmd% 0 p ¥a$:a$ >(a$) íbCmd% 3 a$ "R" pa11$ virfield.MailBase: ╔ Ña10$: ╔ ╛ Ö"MailBase": ╔ Ña11$: wFD1 íbCmd% 2 a$ "D" p ╔ ╛ Ö"MailBase": ╔ Ña10$: wFD1 íbCmd% 1 a$ "K" p ╔ ▒ Ö"MailBase" í B("MailBase") p ├ wFD1 Æ í ía$ "C" a$ (27) p ├ wMF1 ^ íautoman% 2 pnumdups% numdups% 1:bDelete$ "Deleting...":a11$ VirField.MailBase: ╬ ╔ ╛ Ö"MailBase" ╔ Ña10$ wFD1 Æ í Æ í wFD1 EditEnts: ╜ ** Edit command. This command allows you to modify, delete, and look ╜ through all the different records. ╩ ƒ"Edit Mailing List" ret% 9:helpsel% 3 ╩ σ Ñ │ Ñ1,"!activity$=~~:open form ~Mailit~:GOTO H1" Ñ2,"!GOTO Editit" Ñ3,"!GOTO Deleteit" Ñ10,"!GOTO DropFunctions" activity$ "Data Editing Form" ╔ ` ┤ £"AddForm" cc% 1 EE1: ╜ ** This actually searches for the keyboard input and turns the panel ╜ on to allow the searching of records. a$ "" ╩ ╦"ESC=Stop | E=Edit | D=Delete | Shift+F1=Help" ╧ Γ Ñ ¥a$ vFlushBuffer a$ >(a$) ía$ "?" a$ "H" p ┤ £"Mailit": wH1 ía$ "E" wEditit ía$ "D" wDeleteit ía$ (27) a$ "C" a$ "Q" wDropFunctions wEE1 Editit: ╜ ** The user wants to edit this record, so we let them ╩ ╦"Editing Record..." ▀ │ ö1,0 ╠ Ö"MailBase" wEE1 Deleteit: ╜ ** Are you sure you want to delete this record? ╩ ╦"Delete Record..." ┬"Are you sure you wish to delete this record?","",135,n% ín% p ╔ ╛ Ö"MailBase" ╬ wEE1 DropFunctions: ╜ ** Edit Exit. Clear the function keys Ñ2 Ñ3 Ñ10 cc% 0 activity$ "" ┤ £"Mailit" wMainMenu PressanyKey: ╜ ** Subroutine to check for keypress ╩ ╦"Press any Key to continue..." ╧a$ wMainMenu PrintLabs: ╜ ** Labels printing routine. ╜ All labels files have the extension .SBB ╩ ƒ"Print Labels" ╩ ╦"Printing Labels..." c$ "" fln$ "*.SBB" ┬"Select the Labels Definition","To print with:",18,n%,fln$ ín% 0 wMainMenu ¿ ªfln$ xLabData ¢x% 0 q3 ╝a$(x%),e$(x%) c%(x%) x% 1 ▒x% P0: z% 1 ┬"Please choose what field(s)","To sort on:",20,zz%,z%,50,c%,a$ ízz% 0 wMainMenu íz% 1 wPL1 íz% 4 z% 1 p ┬"Illegal Selection,","Re-Enter!",113,n%: wP0 ╩ ╦"One Moment... Creating Index..." activity$ "One Moment," (13) (13) "Building Index..." £1 │ _ wP1 ╛ úVirField wP2 P1: yP2 Æ P2: │ _ wErrtrap «VirField,"VirField ; vtx clc rdo ; 50 ; 14 ; 0 ",e$(z% 1) ë ú │VirField úVirField PL1: ª ╨ ~ å ÿ wMainMenu ╜ ** Lab Data holds the info for the Requester ╜ 20. More sorts can be added by changing the ╜ x% and DIM sizes, and then adding a DATA ╜ statement to the end of this with the title, ╜ then the actual equation to sort by. LabData: è"Don't Sort.","" è"Sort by LastName.","LastName" è"Sort by Zip Code.","Zip" è"Sort by Zip COde and LastName.","pad$(Zip,10)+LastName" Utilities: ╜ ** The Utilities main menu. ╩ ƒ"Mailing List Utilities" £9 ╩ ╦"Select Utility..." Ñ1,"!goto H1" helpsel% 5:ret% 9 U1: ╜ ** detect key entry, etc. a$ "":utilsel% 0 ╧ Ñ ▀ ¥a$:a$ >(a$) vFlushBuffer ╔ µa$ µ"S" wConvertit µ"E" wExportit µ"B" wBackitup µ"H","?" wH1 µ"R" wRestorebase µ"Q", (27) wMainMenu µ ^ │utilsel% wConvertit,Exportit,Backitup,Restorebase,MainMenu,H1 Æ ╔ wU1 Exportit: ╜ ** Allow the user to send out the database as ASCII delimited text ╩ ƒ"Exporting Mail Base" activity$ "" £1 ╩ ╦"Exporting..." ┬"Name of Export File?","",4,n%,fln$,50 ín% 0 wUtilities activity$ "Exporting Mail Base to File '" fln$ "'..." ╬ Ö"MailBase" ù qfln$ ╨ ~ s ( 0(f1$)) ( 0(f2$)), ( 0(r1$)) ( 0(r2$)),"0" wUtilities Backitup: ╜ ** Save that database from the big bad DOS monster ╩ ƒ"Back Up Mail Base" activity$ "" £1 ╩ ╦"Select File Name..." ┬"Backup Database","to Which File?",11,n%,fln$ ín% 0 wUtilities í J(fln$) p ┤ Ö +(fln$, /(fln$) 4): ╛ Ö +(fln$, /(fln$) 4) activity$ "Backing up Mail Base to the new database file '" fln$ "'..." ╩ ╦"Backing up your mail base..." ╬ Ö"MailBase" ╔ t q Öfln$ wUtilities Restorebase: ╜ ** Restore the database back to the MailBase file. ╩ ƒ"Restore Mail Base" ╩ ╦"File to Back up from..." activity$ "" £1 ┬"Restore from","Which File?",11,n%,fln$ ín% 0 wUtilities í J(fln$ ".sbf") 0 p ┬"Cannot find database " fln$,"",113,n%: wUtilities ┬"Proceeding with this action will overwrite","all data in the present database. Continue?",148,n% ín% 0 wUtilities xFieldNameData z1% 0 ╜ ** We are making sure that the user is trying to restore a file that is the same definition as the main MAILBASE file. ┤fln$ ".sbd" ¢ ñ Rb1: ╝b$ ñ ca$ í -(a$,1) ">" pz1% 9 a$ F( +(a$,15)) í >(a$) >(b$) wGetoutofHere íz1% pz1% 0: ñ ca$ íb$ "Misc2" wYeppers wRb1 GetoutofHere: å ñ ┬"This file is not in the Mail Base","format. Re-configure and try again.",113,n% wUtilities Yeppers: ╜ ** The file is in the same format, so we over-write the MailBase file with the new file å ñ activity$ "Restoring database..." ╩ ╦"Restoring database..." £1 cc% 1 ╛ a Ö"MailBase" ófln$ ".sbf" q Ö"MailBase" cc% 0 wUtilities BegStand: activity$ "" £1 ┤ Ö"RuleBase" wCI1 Convertit: ╜ ** this is the infamous standardize routine activity$ "" £9 ╩ ╦"Are you sure?" ╩ ƒ"Standardize Mail Database" Äpth$ ┤ Ö"RuleBase" ┬"This process can take a considerable time for " H( ( A("MailBase"),5,0)) " records,","do you wish to continue?",148,n% ín% 0 wUtilities CI1: ╩ ╦"Standardizing Mail Base..." activity$ "Processing Rule Base..." £1 ctx% 1 ═RuleNum.RuleBase ctx%:ctx% ctx% 1 ctx% 1 ═RecNum.MailBase ctx%:ctx% ctx% 1 úRuleNum.RuleBase £10 rctotal% A("MailBase") rcleft% A("MailBase") rcnum% 0 totrul% A("RuleBase") onrul% 0 vUpdateScreen Ö"MailBase" úrecnum.mailbase ╔ ` Ö"MailBase" ╔ ` Ö"RuleBase" C1: ╜ ** we build the zz$ which is the string of what we are actually looking for ╜ the nsp% means that we either don't care if there is a space at the end (0), or that we DO care (1) ╜ the wh% is set for look for zz$ anywhere (1), just at the end (2), or only at the beginning (3) ╜ the @ is replaced with spaces ¥k$ ík$ (27) p ╔ ╨: ╔ `: wEndStand í B("RuleBase") wCend onrul% onrul% 1 rcnum% 0 rcleft% A("MailBase") vUpdateScreen nsp% 0:wh% 1 z$ LookFor í +(z$,1) "*" pz$ ,(z$,2):wh% 2 í +(z$,1) "^" pz$ ,(z$,2):wh% 3 zz$ "" ¢x% 1 q /(z$) í ,(z$,x%,1) "!" p zz$ zz$ "" ^ í ,(z$,x%,1) "@" p zz$ zz$ " " ^ zz$ zz$ ,(z$,x%,1) Æ í ▒x% í ?(z$,"!") pnsp% 1 ex$ "select where " FieldName.RuleBase " like " (34) "*" H( F(zz$)) "*" (34) ûex$ ex$ "" ╔ ` Ö"Mailbase" C20: ╜ ** now we make the a$ equal the contents of the field we are searching, and add a space at the end (for searching purposes) ex$ "a$=" FieldName.RuleBase ûex$ ex$ "" a$ a$ " " í B("MailBase") p ╔ ▒ Ö"RuleBase": wC1 rcnum% Recnum.mailBase rcleft% rctotal% rcnum% vUpdateScreen CRemake: ╜ ** is zz$ in a$? If yes, then we possibly have a match zz% ?( >(a$), >(zz$)) ízz% 0 p ╔ ▒ Ö"MailBase": wC20 ínsp% 1 ,(a$,zz% /(zz$),1) " " p ╔ ▒ Ö"MailBase": wC20 ízz% 1 wh% 3 p ╔ ▒ Ö"MailBase": wC20 íwh% 2 p ízz% /(zz$) 4 /(a$) p ╔ ▒ Ö"MailBase": wC20 Æ í Æ í ízz% 2 pff$ "" ^ff$ +(a$,zz% 1) af$ ,(a$,zz% /(zz$)) Ct$ ChangeTo pw% 1 í +(Ct$,1) "*" ppw% 2:Ct$ ,(Ct$,2) í +(Ct$,1) "^" ppw% 3:Ct$ ,(Ct$,2) ch$ "" ¢x% 1 q /(Ct$) í ,(Ct$,x%,1) "@" pch$ ch$ " " ^ch$ ch$ ,(Ct$,x%,1) ▒x% í >( ,(a$,zz%, /(ch$))) >(ch$) p ╔ ▒ Ö"MailBase": wC20 í ?(Ct$,"~") pch$ " " ípw% 1 pa$ ff$ ch$ af$ ípw% 2 pa$ ff$ af$ ch$ ípw% 3 pa$ ch$ ff$ af$ ex$ FieldName.RuleBase "=a$" a$ H( F(a$)) ûex$ ex$ "" Ö"MailBase" ╠,1 ╔ ▒ Ö"MailBase" wC20 Cend: ╜ ** all done, let's mosy on out of here Ö"MailBase" ╠,2 å t activity$ "Standardization Complete." (13) ísrtn% pactivity$ activity$ "Now Processing Merge File..." (13) ┤ £"Mailit" ╧ ¢2 EndStand: ísrtn% p ├ wUtilities UpdateScreen: ╜ ** this updates the screen so the user can see why we are taking fourteen hours away from their favorite mailbase file onrul$ H( (onrul%,5,0)) " of " H( (totrul%,5,0)) "." rcleft$ H( (rcleft%,6,0)) rcnum$ H( (rcnum%,6,0)) írcnum% 0 prcnum$ "Searching..." ╬ ├ SetOpts: ╜ ** These commands are mostly front end, All they are doing is asking ╜ the user for a series of values. ╩ ƒ"Set Mail Options" bCancel$ "Cancel" £7 ╩ ╦"ESC=Stop | M=Modify Rules | C=Change Separators" ¼1,0,0," " SO1: optsel% 0:a$ "" ╧ Ñ ▀ íoptsel% 0 p ¥a$:a$ >(a$): vFlushBuffer ía$ "M" optsel% 1 wOptsRule ía$ "C" optsel% 2 wOptsSep ía$ (27) a$ "Q" optsel% 4 wMainMenu ía$ "H" optsel% 5 phelpsel% 7:ret% 9: wH1 wSO1 OptsRule: ╜ OK, here we change and/or add all them rules for the rule base ╜ the rules are. WHEN SEARCHING: ╜ * - Look for this string at the end of the field ╜ ^ - Look for this string at the beginning of the field ╜ @ - this is the same as a space ╜ ! - do not allow the search field to end in a space ╜ WHEN REPLACING: ╜ * - Put the resultant string at the end of the field ╜ ^ - Put the resultant string at the start of the field ╜ @ - Just a space ╜ ~ - Delete this entirely (put nothing in its place) ╩ ƒ"Modify Rule Base" ╩ ╦"Select field to modify..." Ö"MailBase" ┬"Select Field","",9,n%,flnm$ ┤ Ö"RuleBase" ín% 0 wSetOpts ctx% 1 flnm$ F( +(flnm$,15)) ═RuleNum.RuleBase ctx%:ctx% ctx% 1 ╨FieldName.RuleBase flnm$ Ö"RuleBase" ex$ "select where FieldName.RuleBase LIKE " (34) flnm$ (34) ûex$ ex$ "" mdf$ "Modifying the " flnm$ " field" ┤ £"optsel2" cc% 1 ╔ ` Op: ╜ ** this area allows entry into the rule base (and editing, deleting, etc.) ╩ ╦"ESC=Stop | N=New | D=Delete | E=Edit | M=Modify Other" a$ "" ╧ Γ Ñ ╩ ╦"ESC=Stop | N=New | D=Delete | E=Edit | M=Modify Other" ¥a$ vFlushBuffer a$ >(a$) ía$ "N" wOp1 ía$ "M" p å £: wOptsRule ía$ "D" wOp2 ía$ "E" wOp3 ía$ (27) a$ "C" pcc% 0: Γ e: ╔ ╨: ┤ £"Mailit": wMainMenu wOp Op1: ╜ ** Add new rule n$ "":ct$ "" ┬"Enter Value to Look for in Field " flnm$ "?","",4,n%,n$,15 ín% 0 wOp ü Ö"RuleBase" FieldName.RuleBase flnm$ LookFor.RuleBase n$ ┬"Change " n$ " to what?","",4,n%,ct$,40 ín% 0 wOp ChangeTo.RuleBase ct$ RuleNum.RuleBase ctx% ctx% ctx% 1 ╠ Ö"RuleBase" wOp Op2: ╜ ** Delete a rule ┬"Delete the Change " LookFor " to",ChangeTo " record?",135,n% ín% 0 wOp ╔ ╛ Ö"RuleBase" £1 wOp Op3: ╜ ** Edit a rule ┬"Change the " LookFor " to " ChangeTo,"Record?",135,n% ín% 0 wOp n$ LookFor.RuleBase ┬"Alter Look For to ","",4,n%,n$,15 ín% 0 wOp LookFor n$ n$ ChangeTo ┬"Alter Change To Field to ","",4,n%,n$,40 ín% 0 wOp ChangeTo n$ ╠ Ö"RuleBase" ╬ wOp OptsSep: ╜ ** Change the field and record separators bCancel$ "Cancel" fo1$ f1$:fo2$ f2$:ro1$ r1$:ro2$ r2$ ╩ ƒ"Change Export Separators" £8 ╩ ╦"ESC=Stop | F=Fields | R=Records" OS1: ╜ ** menu handler optsel% 0:a$ "" ╧ Ñ ▀ íoptsel% 0 p ¥a$:a$ >(a$): vFlushBuffer ía$ (27) a$ "C" optsel% 99 pf1$ fo1$:f2$ fo2$:r1$ ro1$:r2$ ro2$: wMainMenu ía$ "U" optsel% 999 wMainMenu ía$ "F" p ö6,2: wCheckup ía$ "R" p ö8,2: wCheckup wOS1 Checkup: ╜ ** here we are checking to make sure the user typed in values that are valid ASCII field delimters ╜ if he didn't, we change them back to what they were before. í 0(f1$) 0 .(f1$) 48 pf1$ fo1$ í 0(f2$) 0 .(f2$) 48 pf2$ fo2$ í 0(r1$) 0 .(r1$) 48 pr1$ ro1$ í 0(r2$) 0 .(r2$) 48 pr2$ ro2$ í 0(f1$) 0 0(f1$) 255 pf1$ fo1$ í 0(f2$) 0 0(f2$) 255 pf2$ fo2$ í 0(r1$) 0 0(r1$) 255 pr1$ ro1$ í 0(r2$) 0 0(r2$) 255 pr2$ ro2$ ╬ wOS1 Helpme: ╜ ** Main entrance to the Help area ╩ ƒ"MailBase Help" ret% 0:helpsel% 0 HON: ╜ ** All the help calls from utilities come in here £3 ╩ ╦"Select Help Topic" ¼ e íret% wH1 HNK: ╜ ** help main menu ╧ Ñ ▀ ¥a$:hl% ?("AMELUPOQS", >(a$)) vFlushBuffer ía$ (27) hl% 8 helpsel% 8 wEndHelp íhelpsel% hl% 0 wHNK íhelpsel% 0 phelpsel% hl% H1: ╜ ** actual help area. displays proper screen ┤ Ö"HelpBase" hl$ "<Esc> - Quit back to Main | Any other key for more Help." íret% phl$ "<Esc> - Quit back to Start | Any other key for more Help." ╩ ╦hl$ ╔ ╨Topic helpsel% ╔ ` £4 ízr% 0 ret% pzr% helpsel% ╧ Ñ ▀ ¥a$ vFlushBuffer ía$ (27) >(a$) "Q" wEndHelp wHelpme EndHelp: ╜ ** return to the proper area │zr% wAddEnts,MergeEnts,EditEnts,PrintLabs,Utilities,PurgeEnts,SetOpts wMainMenu Quitit: ╜ ** quit routine ┬"Confirm Exit...","",148,n% ín% 0 wMainMenu ┤"MDefault" ¢ ╢ { ½ å ╢ å t ╩ ƒ"" Γ │ Æ FieldNameData: ╜ this is the data used to make sure the database is in the same format as the mailbase file è"RecNum","VirField","Title","FirstName","LastName","Company","Address1","Address2","City","State","Zip","Country","HomePhone","WorkPhone","FAX","Notes","Entered","Misc1","Misc2" FlushBuffer: ╜ get rid of all those extra typed characters ¥zz1$ ízz1$ "" p ├ wFlushBuffer Errtrap: ╜ an error has occurred. The actual error is in ERRNO, and the name of the error can be acquired with the ERR$() command ╜ an error number 11 is a control-c or a Stop button ╜ a RESUME is necessary to clear the Error condition and to resume with the normal program execution ╜ ** cc%=0 --- error occured with program. Non-expected ╜ ** cc%=1 --- Expected error, return back to next statement (stay in same routine) - I use this for the end-of-file error that occurs when you use WAIT PANEL í & 10 cc% 1 p ╩ ╦"*** End of File ***": : ╧ ¢.5: y ▒ ícc% 1 & 11 pcc% 0: Äpth$: ┤ £"Mailit": yMainMenu í & 11 p Äpth$: ┤ £"Mailit": yMainMenu ícc% 1 p y ▒ ╩ ╦"****" (( &) "****" ╧ ¢1.2 Äpth$ ┤ £"Mailit" yMainMenu