Structures

It is possible to build aggregate variables in EASI by defining and using structures. A structure is composed of any number of basic variables, strings, mstrings, and other structures associated together into a single unit. Once defined, a structure is equivalent to a new variable type available to EASI. Variables of this new type can be declared using LOCAL and GLOBAL statements just like other variables.

Structures are defined using the "DEFINE" command. Since a single structure definition consists of many lines, structures are not defined interactively at the EASI prompt, but normally only in EASI procedures.

An example of a simple structure definition is:

 DEFINE STRUCTURE Point
 DOUBLE X
 DOUBLE Y
 ENDDEFINE

The name of the structure is specified immediately after the "DEFINE STRUCTURE" keywords (in the example above, the structure name is Point), and the structure definition ends with the "ENDDEFINE" keyword. The fields that make up the structure are given in the body of the structure definition. After a structure has been defined, variables may be declared of the new type:

 LOCAL Point p

The fields of the structure are accessed by appending a period "." and the field name after the name of the structure variable.

 p.x = 1.5
 p.y = -5

It is possible for structures to include arrays and other structures as fields.

 DEFINE STRUCTURE DatasetInfo
  STRING Filename
  CHAR MapUnits[24]
  Point UpperLeft
  Point LowerRight
 ENDDEFINE
 LOCAL DatasetInfo Irvine
 Irvine.Filename = "irvine.pix"
 Irvine.MapUnits = "LONG/LAT"
 Irvine.UpperLeft.X = 2342.233

Note here how the "Filename" field is a string, and can hence be of any length, but the "MapUnits" field is an array of chars, and is limited in length to 24 characters.

Finally, it is possible to declare arrays of structures:

 LOCAL DatasetInfo data[5]
 data[1].Filename = "test1.pix"
 data[2].Filename ="test2.pix"

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.