Maptitude GISDK Help

Dialog Box Arguments

 

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

 

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

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

 

Macro "sample macro"

     x_value = 7

     a_values = {2, 4, 6}

 

     RunDbox("change value", x_value)

// x_value does not change

     RunDbox("change value", &x_value)

// x_value is now 99

     RunDbox("change value", a_values[2])

// a_value is still {2, 4, 6}

     RunDbox("change value", &a_values[2])

// a_value is now {2, 99, 6}

     RunDbox("change value", a_values)

// a_values is still {2, 99, 6}

     RunDbox("change value", &a_values)

// a_values is now 99

     a_values = {2, 4, 6}

// reset a_values

     RunDbox("change array", a_values)

// a_values is now {4, 16, 36}

endMacro

 

Dbox "change value" (in_value)

     init do

          in_value = 99

          Return()

          enditem

endDbox

 

Dbox "change array" (a)

     init do

          for i = 1 to a.length

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

               end

          Return()

          enditem

endDbox

 

Arguments 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