Designed to Help You Run Your Business More Efficiently.     
Home  |  About AIMS  |  Contact Us  

  • Clients

  • FAQs

  • Programs

  • Tips

  • Fees

Delete Operations - Addin

Download Compiled Addin (.aex)

View/Download Script as text file.

One of my pet peeves is cleaning out old Saved Operations that have built up over the years and nobody knows what they do any more. This is especially true when it's someone else's app that I'm updating. So, I decided to spend a couple hours developing a routine that could save me 5-10 minutes next time I need to do a Saved Operation cleanup. I guess I'll chalk the negative efficiency up as 'training time' and post the results here for the benefit of others.

The script can be downloaded above as either a compiled addin file or as the raw text. The raw text is actually the Xbasic Export file created by Alpha. To add the script to your own application, just save the attachment to your computer then open A5v5 and right click in the code tab to select the Import operation. From there it ought to be pretty self-explanatory. Of course, you can just open the text file and read it but it's much more readable once it's in the code editor. (If you use Xbasic at all and haven't used the code Export and Import features, you should try them. They're great for backing up scripts, copying them to other dbs, and temporarily removing scripts/functions which aren't wanted when creating .aex files.)

The script determines which operation Types (note types - not names yet) actually exist in the current db and shows a list of them. Once the operation Type is selected, a multi-select list of the specific operations is shown and all operations that you highlight will be deleted. Since A5's built-in delete operation is used for the actual deletion, you will be prompted prior to deleting each operation - but it's still much nicer than doing them one at a time from the Operations tab.

The xdialogs were originally created with the genie but got modified a bit as I progressed through my 'training' and added features and improved some of the processes. I also modified the OK/Cancel button area to get better vertical centering. I used extra semi-colons and removed the region around the buttons. However, this method may not work much longer as Selwyn has threatened to fix the bug that allows me to center the buttons by adding extra semi-colons. When that happens I'll have to switch to using {ysize=}. (Being an engineer by training, I like things nice and neat.)

Some of the features in this script include:
  • the use of STRITRAN to get the plural of a Type based on two lists designed for that purpose. The plural is only used for some messages.
  • the use of EVAL() in a couple places to run multiple Enum and Delete operations in a loop based on values in a crlf() delimited string. (The Eval function is a powerful feature but it takes awhile to get used to the idea of using it and to learn when to use it.)
  • sorting a crlf() string with the SortSubStr() function. (This is really easy but I thought it was worth pointing out that the function exists.)
  • a method I use to test the xdialog exit mode when checking for a double click in a regular list box. When exiting the xdialog based on a double click, the value of a_dlg_button is blank just the same as if the user clicked the 'x' in the upper right corner. Because of this, I had to find a way to determine whether the user had clicked the 'x' or double clicked a value in the list.

AIMS DataCom, Inc. - Custom Database Applications
This site created and maintained by Cal Locklin,, using 1st Page 2000.   Last update:  09-May-03
This site may be freely linked to but not duplicated in any fashion without prior written consent.