Recommendations for Programming with AXIS Script
in AXIS Users Guide - AXIS Script

AXIS Script is a powerful programming tool, with a great many features of VBA supported.  However, we strongly recommend you to stick to the simpler constructions when writing code in Formula Tables, for speed of execution and reliability.  We also have the following recommendations for general programming practice:

Use of File based Functions

It is dangerous to perform file based operations because after a dataset is backed up to another machine, file locations may be quite different, and your code may fail.  Similarly, you are strongly advised not to refer to any specific locations on a hard drive in the code for formula tables. If you do this, you then may have problems using your datasets on other computers. 

Static Variables

We also recommend against the use of the Static keyword in Formula Tables. We have provided predefined Static Variables in certain Formula Tables that you can safely use instead. The variables are initialised at the appropriate time, and then the value is remembered. These are both input and output variables. You can use them for running totals, or running totals with interest. As an example you may set static1 = (static1 + Premium) * (1 + Interest).

Option Explicit

In VBA, you may choose Option Explicit On or Off. The Option Explicit Off statement allows the user to use variables without having to declare them. This is a very dangerous practice. When this statement is set to On, all variables have to be declared before they are used. 

Most modern programming languages do not allow variables to be used before they are declared, because this would allow typos to go unnoticed. In AXIS Script all variables must first be declared. Any Option Explicit statement in AXIS Script will be ignored.

Examples of variable declarations:

Dim V as Integer
Dim D_Rate as Double

Naming Conventions

To prevent conflicts with GGY system variables and conversion problems, we highly recommend that you use the following naming conventions:

    - Use a prefix to your variables. Examples of this:

        - v_TotalFund instead of TotalFund where v stands for user variable,

        - f_ConvertToMpnthly(x) instead of ConvertToMonthly(x) where f stands for user defined function

        - d_rate instead of rate where d stands for double.

    - GGY will never use variables shorter than 4 characters, therefore you should be free to use variables such as i or k for loop counters.