This macro writes a text file with a list of formula fields and their expressions for the current layer. The file is written to the C:\temp folder.

The macro illustrates how to:

  1. Open, write to, and close a text file.
  2. Loop over an array.
  3. Get information about expressions.

You can modify the macro to use a dialog box to choose the name and folder for the output file, handle dataviews as well as layers, etc.


  1. Download the file GISDK_WRITE FORMULAS.ZIP and extract the file WRITE FORMULAS.RSC. A good place to save the resource file is in the GISDK\Samples folder in the Maptitude program folder.
  2. Open or choose the layer that you want to use.
  3. Choose Tools-Add-Ins and open the GIS Developer's Kit toolbox.
  4. Compile this macro in the test mode using the Compile button (first button).
  5. Run this macro by clicking the second button (Test), typing the macro name "Write Formulas", clicking the Macro radio button, and clicking OK.