User Defined Types Cicode Library

Anonymous
Anonymous

Toolbox Template

Cicode Library Using Queues To Emulate User Defined Type Variables

Version
1.00 beta

Requirements
Citect

Description
This Cicode file contains a set of functions for creating and using pseudo User-Defined data Types (UDTs) to store data that is too large or complex to fit in arrays. The data is stored in Cicode queues.

For example, you can create an Address type with Street, City, State, and ZipCode properties. Create a Phone type with Home, Business, and Mobile number properties. Create a Contact type with Address and Phone type properties. Then, create a Contacts UDT variable that contains an array of 100 Contact type properties. Now, for example, you can write to Contact[27].Address.Street. See the included UdtTest() function for an example of how to do this.

Due to the nature of queues, reading and writing properties will become slow if there are many thousands of properties and sub-properties in a UDT variable. To improve performance, there are functions to get a handle to a set of sub-properties or to an individual property for reading and writing. It is also possible to iterate through all the properties of a UDT variable.

Author
Eric Black

Submitter
Eric Black

Attachments