• Clients
• FAQs
• Programs
• Tips
• Fees
|
|
|
Script Formatter
(Last update: 12-15-05)
Download Installation File - for A5v5 through v11
The one install file installs to all applicable versions of A5 that are installed on your computer.
Updated Aug. 01, 2011 - Version #124
What does the AIMS Script Formatter do?
The AIMS Script Formatter standardizes the capitalization, indents, and spaces within your xbasic code for maximum readability. It allows you to adjust the settings to meet your own personal preferences and remembers your last settings as the default. It can even automatically add "highlighting" to labels within your scripts so they are easier to find.

Once your preferences have been established you can use the Quick Mode option to by-pass both the preview window and the 'Save' prompt.
(I hate to have to say this but it also avoids the issue that Alpha's built-in formatter has with nested SELECT statements. If you have nested SELECT statements, Alpha's formatter messes them up and the indents will need to be corrected manually to make them more readable again.)
| If you find this useful, feel free to |
|
to encourage more utilities like this in the future. |
At the very least, e-mail me so I can let you know of future updates.
Features:
- New Feature in version 124 that checks for variables that exist in DIM statements but aren't used anymore.
- New Feature in version 119 that is a sort of combination Hint/Update: Use %dlg% background colors in the xdialog 'code' section and still allow the formatter to re-format that code as necessary.
- Any option can be set to "no change" by un-checking all related option choices.
- Optionally capitalizes all command names for improved readability. Capitalization can be set to UPPER, lower, or First Letter Upper. (Command names include: DIM, OPTIONS, DECLARE, FOR...NEXT, GOTO, IF...THEN, etc.)
- Optionally sets indent levels for loops. The indent level for ELSE and CASE lines can be set to a full tab or to a 'partial' indent to conserve horizontal space. The indent level for CASE lines can even be set to 'none' - this lines up the CASE with the SELECT statement but still indents the lines within each CASE statement.
- Adds a single quote at the end of any simple "END" statement. This allows you to search for END' so you won't find spend a lot of time wading through things like END IF, Send, Recommendation, {endregion}, etc.
- Optionally adds or removes spaces around 'comparison' characters. => =,<,>,<>,<=,>=
- Optionally adds or removes spaces around logical comparisons. => .and., .or., .not.
- Optionally adds or removes spaces around math characters. => +,-,/,*
- Optionally adds or removes spaces at the beginning and end of parenthesis. ==>
ui_msg_box("Title",msg,ui_yes_no) or ui_msg_box( "Title",msg,ui_yes_no )
- Optionally adds or removes spaces after commas. ==>
ui_msg_box( "Title",msg,ui_yes_no ) or ui_msg_box( "Title", msg, ui_yes_no )
- Optionally adds dashed lines above and below labels to make them easier to find:
'--------------
MyLabel:
'--------------
- Will NOT change anything inside crlf() lists (%xxxx%). This includes xdialog box definitions as well as any other crlf() lists. One exception - any list named %code% will be treated like any other code except that the indents will be started over at 0 (the left border) for everything within the %code% section.
(Version 119 update: There is now a way to format code within %dlg% sections. See version 119 details.)
Running AIMS Script Formatter addin:
- A5 must be restarted after installing the addin.
- When actually editing xbasic code, go to the menu bar and click Code/Addins to start the Script Formatter addin.
- When in the Code tab of the Control Panel, either select Code from the menu or right click in the white area and click Addins at the bottom of the drop-down list.
- The rest should be self-explanatory.
What files will be installed?
- AIMS_Script_Formatter.aex will be installed in the Addins_installed folder under the folder where your A5v5, v6, and/or v7 program was installed. This is the file that actually contains the code.
- AIMS_Script_Formatter.code_editor and AIMS_Script_Formatter.new_code will be installed in the Control_Panel_Addins folder(s). 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.
Version Updates:
Version 124: 2011-08-01
- Added routine to check for DIMed variables that aren't used.
- Fixed a problem that caused lines beginning with special characters to lose that special character. This was mostly an issue when using "\" as a line continuation character.
- Fixed a problem with adding spaces in parentheses. If it's only a number such as crlf(2), adding extra spaces seems like too much. It was returning "crlf( 2)" whenever there was more than one "(" in the line.
Version 122: 2006-01-01Jan-06
- Fixed an another error recently introduced (v121?) that caused the routine to indent the %code% section at the same level as the surrounding code. This would sometimes cause an error message when running the code if the ending %code% line was indented.
Version 121: 2005-12-21
- Fixed an error introduce in version 119 that caused the routine to lose track of the original indent level after the %code% section of an xdialog ended. (Indenting continued but at the wrong base indent level.)
Version 120: 2005-12-15
- Fixed an error introduce in version 119 that caused the routine to crash.
|
|