About structures

A structure is a collection of one or more related variables of the same or different datatypes grouped under a single name. In some languages, such as Pascal and COBOL, structures are called records.

Structures allow you to refer to related entities as a unit rather than individually. For example, if you define the user's ID, address, access level, and a picture (bitmap) of the employee as a structure called s_employee, you can then refer to this collection of variables as s_employee.

Two kinds

There are two kinds of structures:

  • Global structures, which are not associated with any object in your application. You can declare an instance of the structure and reference the instance in any script in your application.

  • Object-level structures, which are associated with a particular type of window, menu, or user object, or with the Application object. These structures can always be used in scripts for the object itself. You can also choose to make the structures accessible from other scripts.

Deciding which kind you want

When you design your application, think about how the structures you are defining will be used:

  • If the structure is general-purpose and applies throughout the application, make it a global structure.

  • If the structure applies only to a particular type of object, make it an object-level structure.