TYPE … END TYPE
Syntax
TYPE Xbasic_Structure_Name
SubVariable1 as Type1
SubVariable2 as Type2
SubVariableN as TypeN
END TYPE
|
Argument |
Description |
|
Xbasic_Structure_Name |
The generic name of the variable type that you are creating. |
|
SubVariable1 ... SubVariableN |
The names of the components of the structure. |
|
Type1 ... TypeN |
The variable type of each component:
|
Description
TYPE…END TYPE defines an Xbasic structure, which allows you to quickly define dot variables with sub-variable names defined by the Xbasic_Structure_Name.
TIP: In many cases, using an Xbasic class will be preferable to using the TYPE command. See example below.
Examples
|
' Declaring Variables Using a Structure ' Define the structure. type customer name as C company as C phone as C age as N end type dim cust as {customer} ? properties_enum(cust) = "NAME COMPANY PHONE AGE " dim custs[10] as {customer} ? properties_enum(custs[1] ) = "NAME COMPANY PHONE AGE " ' The Windows POINT structure would be represented by : type point x as integer y as integer end type ' a new type contain point types type line x as {point} y as {point} end type
'Using an Xbasic class define class myclass |
See Also
Language Reference, Reserved Words, DIM
Supported By
Alpha Five Version 5 and Above