NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Structure Statement

Used to create a user-defined class containing one or more elements of a class.

[Public|Private|Friend] Structure varname
NonMethod Declarations
Method Declarations
End Structure

The Structure statement syntax has these parts:

Part Description
Public Optional. Entities declared with the Public modifier have public access. There are no restrictions on the use of public entities
Private Optional. Entities declared with the Private modifier have private access. A private entity is accessible only within its declaration context, including any nested entities.
Friend Optional. Entities declared with the Friend modifier have friend access. An entity with friend access is accessible only within the program that contains the entity declaration.
varname Required. Name of the user-defined type; follows standard variable naming conventions.

Remarks

Structures support many of the same features of classes. For example, structures support the ability to define properties, methods, and events with each member defined with either private, friend, or public accessibility. Structures can implement interfaces and handle events. Structures can have parameterized constructors.

The following features of classes are not supported by structures:

The fact that structures are value types rather than reference types are reflected in their use rather than their declaration. Specifically:

Note that structures do not support the data member declaration syntax supported by UDTs where the statement simply contained the variable name and an As clause without an initial “Dim” or “Public”.

See Also