Fix Array Brackets
Purchase the Addin Download Update 105
Why/when is AIMS Fix Array Brackets needed?
In A5v4, array variables were defined using parenthesis such as: DIM MyArray(10) as C. In version 5, the parenthesis were still supported but the recommendation was to use square brackets because they would be required in version 6. With version 6, all arrays must be defined with square brackets or the script will crash.
This means that any "legacy" applications will have to be updated to square brackets before they can be used in version 6.
What does AIMS Fix Array Brackets do?
This addin searches scripts for the use of arrays and converts any array with parenthesis to an array with square brackets. This creates a huge time savings and greatly improved accuracy when updating older applications for use in A5v6.
A real life example: a conversion of 276 scripts and functions resulted in 266 changes and that part of the update took less than 10 seconds. It took another minute or two to update 31 locations in 59 forms. This probably would have taken at least two hours of manual effort and, even more important, a manual check would probably have missed a few of those 297 changes. It might even take a lot longer than two hours but I don't want to be the one to find out!
The routine first creates a list of all global arrays (DIM GLOBAL) that are defined in global scripts and functions (UDFs) then checks and fixes array variables in both the global scripts/functions and any scripts found in forms.
Once installed, this function becomes available as an addin in the Code tab, the Forms tab, and in the Script editor. This means that (a) it can be used to update all global scripts and functions plus all Form events/objects at one time and (b) it can be used to update individual scripts (global or on buttons, events, etc.) as needed. However, the recommended method is to run it from either the Code tab or the Forms tab and convert all scripts, functions, and Form objects at once.
Running AIMS Fix Array Brackets addin:
What files will be installed?
- A5v5 must be restarted after installing the addin.
- When in the Code tab of the Control Panel (recommended), start by either selecting Code from the menu bar or right clicking in the white area. Then click Addins at the bottom of the drop-down list that appears and select Fix Array Brackets.
- When actually editing xbasic code, go to the menu bar and click Code/Addins and select the Fix Array Brackets addin.
- The rest should be self-explanatory.
- Fix_Array_Brackets.aex will be installed in the Addins_installed folder under the folder where your A5v5 and/or A5v6 program was installed. This is the file that actually contains the code.
- Fix_Array_Brackets.code_editor, Fix_Array_Brackets.new_code, and Fix_Array_Brackets.new_forms will be installed in the Control_Panel_Addins folder under the folder where the full version of your A5v5 and/or A5v6 program was installed. These files add icons to the "Addins" selection when you right click in the blank area of the Code tab or on the Code Editor menu (Code/Addins) when you are actually editing code.