Maptitude GISDK Help

Macro Arguments

 

A GISDK macro accepts up to eight arguments. If a GISDK macro is called with more arguments than it accepts, the extra arguments are ignored. If a GISDK macro is called with fewer arguments than it requires, then the missing arguments are initialized to null.

 

Arguments passed to a GISDK macro cannot be altered by the called GISDK macro unless one of the following is true:

If either of these is true, changes made to the argument in the GISDK macro affect the value in the caller. Here are some examples:

 

Macro "sample macro"

     x_value = 7

     a_values = {2, 4, 6}

 

RunMacro("change value", x_value) // x_value does not change

RunMacro("change value", &x_value) // x_value is now 99

RunMacro("change value", a_values[2]) // a_value is still {2, 4, 6}

RunMacro("change value", &a_values[2]) // a_value is now {2, 99, 6}

RunMacro("change value", a_values) // a_values is still {2, 99, 6}

RunMacro("change value", &a_values) // a_values is now 99

a_values = {2, 4, 6} // reset a_values

RunMacro("change array", a_values) // a_values is now {4, 16, 36}

endMacro

 

Macro "change value" (in_value)

     in_value = 99

endMacro

 

Macro "change array" (a)

     for i = 1 to a.length

          a[i] = a[i] * a[i]

          end

endMacro

 

Values can also be communicated to a GISDK macro using shared or global variables. For more information, see Variable Scope.

 

 

©2025 Caliper Corporation www.caliper.com