AIMS Index_Rebuild Creator
Purchase the AIMS Index_Rebuild Creator
One registration is used for A5v5 through v12.
ABOUT THE AIMS Index_Rebuild Creator:
The AIMS Index_Rebuild Creator is an Alpha Five addin created by AIMS DataCom that builds a function (named Index_Rebuild_Auto() by default) that will rebuild indexes for all or selected tables to their original specifications. This function is automatically saved to your Code tab. When an application is ready for distribution and all required indexes have been defined, the Create_Index_Rebld_Auto() routine will read the index definitions and create the Index_Rebuild_Auto() function to rebuild the indexes to their original definition even if one or more of the indexes has been lost or modified for any reason. (Depending on how the application is distributed, an index might be deleted or modified by the user. Indexes can also disappear if they have a filter and the filter cannot be properly evaluated for some reason.)
The installation routine adds a new function to Alpha Five called Create_Index_Rebld_Auto(). This new function is used to create the Index_Rebuild_Auto() function that is used to rebuild indexes for a specific application. To create the Index_Rebuild_Auto() function for a specific application, go to A5's Interactive Window and enter "Create_Index_Rebld_Auto()" then press the Enter key and a prompt window will appear:
If it is not saved as a function, the script will be saved to the clipboard. To see what the option to rebuild only "developer indexes ending with an underscore" is all about, see recommendation #1 in my report on A5 Naming Conventions. (Sorry, since I originally built this for myself, it only knows my conventions.)
To let the user run the actual index rebuild, simply put the Index_Rebuild_Auto() function on a button. When the user clicks the button, a window will appear for the user to select which tables should be updated:
The default is "All". The function also accepts optional commands to run without the prompt or to update only selected tables - see the function's bubble help for details.
Note: The user prompt is optional - it can be skipped by setting the "Prompt" argument to false: Index_rebuild_auto(.F.)
Hint: It was created as a function so arguments could be set to run it, for example, from the Autoexec script without the prompt as described above or for updating indexes for specific tables before running critical operations - Index_Rebuild_Auto(.F.,.T.,"Customer_Info"). Multiple tables can be updated by using a crlf list of table names.
The difference between the Index_Rebuild_Auto() function and Alpha Five's built in <tbl>.Update_production_index() function is that the built in function will only update existing indexes to their current definition - it will not restore any indexes that are missing or that have been modified from the original definition.
To install the AIMS Index_Rebuild Creator, simply run the installation routine. This installs the addin to the Addins_Installed folder of all full versions of the Alpha5 program that are installed on your computere (A5 versions 5 and above).
RUNNING THE AIMS Index_Rebuild Creator:
- To build a new Index_Rebuild_Auto() function, simply go to the Interactive Window and type the function name - Create_index_rebld_auto().
- To let a user rebuild indexes, simply put the Index_Rebuild_Auto() function on a button.
- To rebuild an index or indexes automatically (without user intervention), simply add the Index_Rebuild_Auto() function to the appropriate script and set the desired options - see the bubble help for option details.
- Added new Create_index_missing_chk() function. Like the original function, this function creates a new function which can be used to very quickly
check for the existance of all index names. It does not validate the index itself - only that the name still exists. It is intended only as a
debugging aid if you have problems with missing indexes. In one test it checked index names for 122 tables in 1.1 seconds. It can also check index names
for any list of tables - which means it can check, for example, 5 tables used in a set in less than 1/4 second.
- Removed option to rebuild "developer indexes only". There were too many potential negative consequences with this.
- Fixed issue with Del_shadow_indexes().
- Revised check for shadow tables to handle the revised file sizes in v11.
- Added routine to check for active link tables in the "Create..." routine. (Previous update just checked when running the resulting Index_rebuild_auto() function and this resulted in errors.)
1.16/17 Details lost in hard drive crash.
- Added check for Active Link tables.
- Modified PleaseWait dialog to show the number of indexes being updated.
- Modified "del_all_indexes" routine to handle open tables and specific "skip/update" selections.
- Modified "not_exclusive" routine because of error message changes in newer versions of Windows.
- Added check for shadowed tables in "del_indexes" routine.
- Fixed problem with the "Compare Indexes" option. If the user chose the option to "Rebuild to Current Definitions", it still rebuilt to the new definitions.
- Modified the 'delete index file' routine so it will not delete the .cdx file if it is for a local table. (CDX files for shadowed tables should never be on the workstation and are automatically deleted by the Index_rebuild_auto() routine if they exist.)
- Modified to ignore the new "__A5_Record__" indexes in v9.
- Any errors that occur when running the Index_Rebuild_Auto() routine will now be stored in a text file named Index_Rebuild_ErrorLog.txt for future reference.
- Updated to ignore the new "__A5_Record__" indexes in v9.
- Fixed problem with the "Ignore Selected" option. If a table such as "Internal_Parts" was selected as a table to be ignored, any other table that was a substring of that table, such as "Parts", was also ignored.
- Modified the 'File not exclusive' error trap to handle the new error text in Alpha. This re-establishes the ability to skip tables that are being used by others and continue with subsequent tables.
- Modified the selection process so that selecting a table that ends with the characters "all" will not cause the selection to change to "All" tables.
- Modified this install routine to work *correctly* with A5v9. Due to limitations created by Alpha, this requires that the person installing this addon must have permission to install to, and create if necessary, the Addins_Installed folder under the A5v9 executables folder. In many cases, especially with Vista, this will mean adminstrator privileges.
- Modified install file to work with A5v9.
- Added routine to make it optional to allow users to "compare index definitions". (See version 1.02) This was done to save 20-30% of the characters when building indexes for very large applications - especially in A5v5.
- Fixed Variable "i" not found error introduced in last update.
- Added version number to header of dialog.
- Dimensioned (DIM) all variables and eliminated global variables to avoid errors when run with other programs that use the same variable names.
- Fixed font setting that caused an error when the "Warn If Different" option was set and the existing indexes were different than the original indexes.
- Updated install routine to work with Vista.
- Minor modifications to make it work in A5v8.
- Added ability to compare existing indexes with original index list and either rebuild original or just update the current production indexes. This comparison is done table by table. To use this option, set the Allow_comparisons option to .T.
- Modified routine to build much larger scripts resulting from more tables and/or indexes. This included adding a horizontal scroll bar for the list of tables in the dialog window.
- Changed routine to correctly handle index names with quotes in them. This is not generally good naming practice but if a set is linked with on a simple value like "A" (including the quotes), then the system will assign the name "A" (including the quotes) to the index.