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

baseClassName

TABLEDEF

Identifies the object as an instance of the TableDef class

className

(TABLEDEF)

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

constraints

AssocArray

An array of row-level constraints associated with the table being defined.

database

Object

A reference to the Database object to which the table being defined is assigned.

fields

Object

A reference to an array that contains the table's Field objects

indexes

Object

A reference to an array that contains the table's Index objects

language

Empty string

The Language Driver currently being used to access the table being defined

parent

null

Container, form or report

primaryKey

Empty string

The key expression of the table's primary index

recordCount

zero

Number of records in the table being defined

tableName

Empty string

The name of the table being defined

tableType

DBASE

The current table type

version

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"