A struct type is instantiated just like any other DataFlex type.
tUSAddress myAddress
The above creates a variable named myAddress of the struct type tUSAddress.
Struct types can also be used as parameter and function return types as well as properties. For example…
Class cMyButton is a Button
Procedure Construct_Object
Forward Send Construct_Object
Property tUSAddress pCurrentAddress
End_Procedure
Procedure SaveAddress tUSAddress myBillingAddress
//...
End_Procedure
Function CreateAddress Returns tUSAddress
tUSAddress myAddress
//...
Function_Return myAddress
End_Function
Function TransformAddresses tUSAddress[] adresses Returns tUSAddress[]
tUSAddress[] returnAddresses
//...
Function_Return returnAddresses
End_Function
End_Class
Members of a struct variable are accessed using the member access operator (the dot operator).
Integer iZipCode
Move "Miami Beach" to myAddress.sCity
Move myAddress.iZipCode to iZipCode
For more information about structs refer to the Struct command.