Syntax |
Type username |
Description |
The Type statement creates a structure definition that can then be used with the Dim statement to declare variables of that type. The username field specifies the name of the structure that is used later with the Dim statement. |
Comments |
Within a structure definition appear field descriptions in the format: variable As type where variable is the name of a field of the structure, and type is the data type for that variable. Any fundamental data type or previously declared user-defined data type can be used within the structure definition (structures within structures are allowed). Only fixed arrays can appear within structure definitions. The Type statement can only appear outside of subroutine and function declarations. |
|
When declaring strings within fixed-size types, it is useful to declare the strings as fixed-length. Fixed-length strings are stored within the structure itself rather than in the string space. For example, the following structure will always require 62 bytes of storage: Type Person Note: Fixed-length strings within structures are size-adjusted upward to an even byte boundary. Thus, a fixed-length string of length 5 will occupy 6 bytes of storage within the structure. |
Example |
This example displays the use of the Type statement to create a structure representing the parts of a circle and assign values to them. Type Circ Sub Main() |
See Also |
T |