Maptitude GISDK Help

Class Variables

 

Class variables are defined using a Static statement. They have class scope, so that the same variable will be referenced by any class macro for any object of that class. For example, in your Init macro, you could declare class variables, and then have them available to class macros:

 

Class "Line" (coords)

 

     Init do

          static shapepoints

 

          shapepoints = coords

          endItem

 

     Macro "numpts" do

          Return (shapepoints.length)

          endItem

 

endClass

 

Macro "Create and Report on a Line Object"

 

     // Create the line object

     dim coords[2]

     coords[1] = Coord(-71211737, 42330501)

     coords[2] = MoveAlongGreatCircle (coords[1], 45, 100)

     myLine = CreateObject("Line", coords)

 

     // Use the numpts class macro

     num = myLine.numpts()

     ShowMessage("The number of points is " + String(num))

endMacro

 

 

©2025 Caliper Corporation www.caliper.com