DATA

Define a DATA instance variable for the objects of a class

Syntax

DATA <DataName1> [,<DataNameN>] [ AS <type> ] [ INIT <uValue> ]

Arguments

<DataName1> Name of the DATA

<type> Optional data type specification from the following: Character, Numeric, Date, Logical, Codeblock, Nil

<uValue> Optional initial value when creating a new object

Description

DATA elements can also be thought of as the "properties" of an object. They can be of any data type, including codeblock. Once an object has been created, the DATA elements are referenced with the colon (:) as in MyObject:Heading := "Last name". Usually a class also defines methods to manipulate the DATA.

You can use the "AS " clause to enforce that the DATA is maintained as a certain type. Otherwise it will take on the type of whatever value is first assigned to it.

Use the "INIT " clause to initialize that DATA to whenever a new object is created.

Examples

CLASS TBColumn
DATA Block // Code block to retrieve data for the column
DATA Cargo // User-definable variable
DATA ColorBlock // Code block that determines color of data items
DATA ColSep // Column separator character
DATA DefColor // Array of numeric indexes into the color table
DATA Footing // Column footing
DATA FootSep // Footing separator character
DATA Heading // Column heading
DATA HeadSep // Heading separator character
DATA Width // Column display width
DATA ColPos // Temporary column position on screen
METHOD New() // Constructor
ENDCLASS

Status

Ready

Compliance

DATA is a Harbour extension.

Platforms

All

See Also