Documentation (c) 2006-2008 Hobby-Robotics, LLC


Structures

Structure can be used to group related fields (values) into a user defined type which can be used to declare global and local variables. Structure fields can be any combination of SByte, Byte, Short, UShort, Integer, UInteger and Single types.

Structures can be global or local, can be passed by reference as arguments and can be returned from Function. Structure can be assigned to another structure of the same type. Structures follow the same visibility rules as variables. Global structures are limited in size by the available amount of memory and compiler limit of 256 Bytes . Local structures have size limited by the local stack limit and current compiler limit of 256 Bytes. Global structures can be initialized when defined with Dim keyword, local structures can not be initialized.

Example:

Structure MyStructure

byte_field As Byte

short_field As Short

End Structure

Dim str As MyStructure = { 255, -1000}

Limitations:

String type fields are not supported in this release.

Total structure size is limited to 256 bytes.