Structure Members

Structure members are the members declared in the structure body and the members inherited from the System.ValueType type.

struct-member-declarations:

struct-member-declaration

struct-member-declarations   struct-member-declaration

struct-member-declaration:

constant-declaration

field-declaration

method-declaration

property-declaration

event-declaration

constructor-declaration

static-constructor-declaration

Class member declarations described in corresponding subsections of the Classes section can also be applied to structures, excluding the differences described in the Differences Between Structures and Classes subsection.

Example

Interface IUserStruct
    Property Title: string
        Get;
        Set;
    End Property;
End Interface;

Struct UserStructure: IUserStruct
    s: string;
    Public Param1: integer;
    Public Param2: double;
    
    Public Property Title: string
        Get
        Begin
            Return s;
        End Get
        Set
        Begin
            s := Value
        End Set
    End Property;

    Constructor Create(Title: string; Param1Value: integer; Param2Value: double);
    Begin
        s := Title;
        Param1 := Param1Value;
        Param2 := Param2Value;
    End Constructor;
End Struct;

Sub Test();
Var
    StructObj: UserStructure;
Begin
    StructObj := New UserStructure("User structure"1003.14);
End Sub;

See also:

Structures