class TableDef
Creates a reference from which to view the definition of a table.
Syntax
[<oRef>]=new TableDef( )
<oRef>
A variable or property in which to store a reference to the newly created TableDef object.
Properties
The following tables list the properties and methods of the TableDef class. No events are associated with this class. For details on each property, click on the property below.
Property |
Default |
Description |
TABLEDEF |
Identifies the object as an instance of the TableDef class | |
(TABLEDEF) |
Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName | |
AssocArray |
An array of row-level constraints associated with the table being defined. | |
Object |
A reference to the Database object to which the table being defined is assigned. | |
Object |
A reference to an array that contains the table's Field objects | |
Object |
A reference to an array that contains the table's Index objects | |
Empty string |
The Language Driver currently being used to access the table being defined | |
null |
Container, form or report | |
primaryKey |
Empty string |
The key expression of the table's primary index |
zero |
Number of records in the table being defined | |
Empty string |
The name of the table being defined | |
DBASE |
The current table type | |
7 |
The tableLevel version number | |
|
|
|
Method |
Parameters |
Description |
load( ) |
|
Loads the table's definition into memory |
Description
A TableDef object allows you to view various aspects of a table's definition. Using the TableDef object does not let you make changes to the table's definition, but instead provides a means to read information about it's index tags, fields, constraints and other elements. For information on making changes to a table's definition, see Table Designer.
To view a table's definition you must create an instance of the object, provide the table name and load the definition using the TableDef object's load( ) method.
t=new TableDef()
t.tableName="tablename"
t.load()
Once the table's definition has been loaded, you can view it's contents through The Inspector:
inspect(t)
or using dot notation from the Command Window:
?t.fields.size
?t.fields[n].fieldname // Where n is a number from 1 to the value of "t.fields.size"
?t.indexes.size
?t.indexes[n].indexname // Where n is a number from 1 to the value of "t.indexes.size"