Table Functions and Methods

Alpha Five provides the following table methods based on the default TABLE object. Prefix the following methods with the keyword "TABLE".

Method

 

Description

.ACTUAL_FILENAME_GET()

V5

Returns the real filename (as opposed to the filename of the shadow table) of tablename.

.ADD_FIELDS()

V5

Adds new fields to an existing table.

.CREATE_BEGIN()

V5

Used together with the TABLE.FIELD_ADD() and TABLE.CREATE_END() methods to define and create a new table file.

.CREATE_END()

V5

Completes the definition of a table structure that was initiated by the TABLE.CREATE_BEGIN() method.

.CREATE_SHADOW()

V5

Creates a shadow table or set that points to a physical table or set.

.CURRENT()

V5

Returns an object pointer (<TBL>) to an open table in the current session.

.DELETE_FIELDS()

V5

Deletes fields from a table.

.ENUM_OPEN()

V6

Returns a list of open tables.

.ENUM_SESSION_OPEN()

V6

Returns a list of tables open in the current session.

.ERASE()

V5

Removes the specified table or set file (Filename), its production index file, and its data dictionary from disk.

.EXTERNAL_CALCS_GET()

V5

Returns a list of externally defined calc fields for a table.

.EXTERNAL_FIELD_

NAME_GET()

V5

Creates a CR-LF delimited string with information about the fields in tablename.

.EXTERNAL_INDEX_DEF_
FROM_NAME_GET()

V5

Retrieves external index information given a table or set name and description.

.EXTERNAL_INDEX_

EXTERNAL_DEF_ENUM()

V5

Returns a list of the indexed fields for the table.

.EXTERNAL_INDEX_

NAME_GET()

V5

Returns a list of a table's indexed fields.

.EXTERNAL_RECORD_

CONTENT_FROM_KEY_GET()

V5

Returns a CR-LF delimited list of records from an external table.

.EXTERNAL_RECORD_
CONTENT_GET()

V5

Creates a CR-LF delimited string of values from a table.

.EXTERNAL_

VARIABLES_GET()

V5

Returns a list of externally defined variables.

.FIELD_ADD()

V5

Adds a new field to a table.

.FILENAME_GET()

V5

Returns the filename of tablename.

.GET()

V5

Takes the Alias of an open table and returns an object pointer to this table.

.GET_SOURCE_TYPE()

V5

Returns the Type of table referenced by DBF_filename.

.IN_USE()

V5

Returns .T. (TRUE) if Filename is currently in use in any session.

.ISOPEN()

V5

Returns .T. (TRUE) if Table name is open in the current session.

.OPEN()

V5

Opens an existing table or set, and returns a pointer (<TBL>) that references the table, or in the case of a set, the parent table of the set.

.OPENMAP()

V6

Opens an existing table or set with a specified list of fields, and returns a pointer.

.OPEN_SESSION()

V5

Open an existing table in a new session.

.RELATED_TABLES_GET()

V5

Returns a list of the tables in a set that can represented with a lookup expression to the table.

.REMVE_RECS_IN_LIST()

V5

Removes all of the records contained in the Remove_List table from the records in the Primary_Table.

.RESET()

V5

Changes a session's primary table to a different table as specified by Filename. Returns the <TBL> pointer to the table that is opened.

.SEND()

V5

Sends a table via the current MAPI email client, or the built-in Alpha Five email client.

.TEMPORARY_CLOSE()

V5

Closes temporary tables.

.TEMPORARY_OPEN()

V5

Opens temporary tables for caching.

.XML_EXPORT()

V5

Exports data to an XML file.

.ZIP()

V5

Creates a zip file containing the table specified by tablename.

Prefix the following methods with the <TBL> pointer. Use the TABLE.OPEN(), TABLE.CREATE_END(), and <OBJECT>.TABLE_GET() methods to return the <TBL> pointer.

Method

 

Description

.ADD_BLANK_RECORDS()

V5

Adds Num_Records of blank records to <TBL>.

.APPEND()

V5

Appends the records of <TBL> to another table.

.BATCH_BEGIN()

V5

Placed at the start of a special batch operation for a particular table to improve the speed of the operation.

.BATCH_END()

V5

Terminates the special optimized batch operation that was started by <TBL>.BATCH_BEGIN().

.BOF()

V5

Returns .T. (TRUE) if the current record is the first record in the logical order specified by Index_Name.

.CHANGE_BEGIN()

V5

Initiates a change operation on the current record in <TBL>.

.CHANGE_END()

V5

Used after <TBL>.CHANGE_BEGIN() when changes to fields in the record buffer are complete, to save the field values in the current record.

.CHILD_GET()

V5

Returns the Table_Alias of the Nth table.

.CLOSE()

V5

Closes <TBL>.

.COMPACT()

V5

Compacts the table (.dbf file) or data dictionary as specified by filename.

.COPY()

V5

Copies all or some of the fields from <TBL> or set to a new table.

.COPY_RECORD_TO()

V5

Copies the current record in the source table to the target table specified by Table_Name

.COPY_RECORDS_TO()

V5

Copies records in the source table to the target table specified by Table_Name

.CREATE_CLONE()

V5

Creates a new empty table that matches the structure of <TBL>.

.CROSSTAB()

V5

Cross-tabulates the records of a table or set, creating a new table.

.DECRYPT()

V5

Decrypts the <TBL>.

.DELETE()

V5

Deletes the current record in <TBL>.

.DELETE_DUPS()

V5

Deletes duplicate records in <TBL>.

.DELETE_RANGE()

V5

Deletes selected records in <TBL>.

.DUPLICATE()

V5

Makes a duplicate copy of <TBL>.

.ENCRYPT()

V5

Encrypts <TBL>.

.ENCRYPTED()

V5

Returns .T. (TRUE) if <TBL> is encrypted.

.ENTER_BEGIN()

V5

Initiates an enter operation to add a new record to <TBL>.

.ENTER_END()

V5

Used after <TBL>.ENTER_BEGIN(), completes the creation of a new table record, saving the contents of the current record buffer.

.ENUM_SYNTAX()

V5

Enumerates ODBC driver syntax elements.

.EOF()

V5

Returns .T. (TRUE) if the current record is the last record in the logical order specified by Index_Name

.EVAL()

V5

Evaluates an expression in the context of a table.

.EVAL_VALID()

V5

Returns .T. (TRUE) if an expression is valid in the context of a table.

.EXPORT()

V5

Exports the records of a table or set to a file of a different format.

.FETCH_EOF()

V5

Returns .T. (TRUE) if the most recent fetch in <TBL> has tried to read past the end of the file, creating an end of file condition.

.FETCH_FIND()

V5

Retrieves the first record in <TBL> with a primary index key equal to the Matching_Expression parameter.

.FETCH_FIRST()

V5

Retrieves the first record in <TBL>.

.FETCH_GOTO()

V5

Retrieves the specified Record_Number.

.FETCH_LAST()

V5

Retrieves the last record in <TBL>.

.FETCH_LOC_NEXT()

V5

Retrieves the next record in <TBL> with a field value that equals Matching_Expression.

.FETCH_LOC_PREV()

V5

Retrieves the previous record in <TBL> with a field value that equals Matching_Expression.

.FETCH_NEXT()

V5

Retrieves the next record in <TBL>.

.FETCH_PREV()

V5

Retrieves the previous record in <TBL>.

.FIELD_BLANK()

V5

Blanks the contents of a field.

.FIELD_GET()

V5

Returns the <FIELD> object pointer that references a particular field specified by number or by name.

.FIELD_INFO_DUMP()

V6

Returns a CR-LF delimited list of information about a table's fields.

.FIELD_NAME_GET()

V5

Returns the name of a field.

.FIELD_SPACE_USAGE()

V6

Scans all of the data in a table and reports the minimum size needed for each field.

.FIELD_STATISTICS()

V5

Computes statistics (first value, last value, minimum value, count, total, average, standard deviation and variance) for Expression, for all of the currently selected records in the table referenced by <TBL>.

.FIELDS_GET()

V5

Returns an object pointer to a field in the table.

.FILE_MODE_GET()

V5

Returns the mode in which <TBL> was opened.

.FILENAME_GET()

V5

Returns the filename of <TBL>.

.GET_GROUP_NAME()

V5

Returns the group of a table.

.GET_INDEX_EXTENSION()

V5

Returns the extension of the associated index file for a particular Alpha Five object type.

.GET_MEMO_EXTENSION()

V5

Returns the extension of the associated memo file for a particular Alpha Five object type.

.GET_SYNTAX()

V5

Returns the syntax for an ODBC setting.

.HANDLE()

V5

Returns the old style (Version 1) handle when using a new style (Version 3 and above) Xbasic object.

.HANDLE_SET()

V5

Sets the handle number of a table.

.HANDLES_IN_USE()

V5

Returns a list of the handles currently in use.

.IMPORT()

V5

Import the records of a file of a different format into a new table file.

.INTERSECT()

V5

Creates a new table by merging the records from <TBL> with matching records from a Secondary table. The new table contains only those records from <TBL> that have a matching record in the Secondary table.

.IS_DELETED()

V5

Returns .T. (TRUE) if the current record has been deleted.

.IS_MARKED()

V5

Returns .T. (TRUE) if the current record is marked.

.IS_RECORD_LOCKED()

V5

Returns .T. (TRUE) if the current record is locked.

.IS_UNMARKED()

V5

Returns .T. (TRUE) if the current record is not marked.

.IS_VALID()

V5

Returns .T. (TRUE) if the table is valid; otherwise, it returns .F. (FALSE).

.JOIN()

V5

Create a new table by merging the records from <TBL> with matching records from a Secondary table. The new table contains every record from <TBL>, whether or not a matching record is found in the Secondary table.

.LOGICALRECORD_GET()

V6

Returns the logical record number in the current sort order.

.LOGICALRECORD_SET()

V6

Sets the record pointer to a specified logical record number in the current sort order.

.MARK()

V5

Marks the current record.

.MARK_DUPS()

V5

Marks duplicate records in <TBL>.

.MARK_DUPS2()

V6

Marks all records with duplicate values (i.e. N records), as Compared with <TBL>.MARK_DUPS(), which marks only the records after the initial records (i.e. N-1 records).

.MARK_RANGE()

V5

Mark selected records in <TBL>.

.MEMO_CHECK()

V6

Checks the integrity of memo fields and repairs them.

.MODE_GET()

V5

Returns a number that indicates the current Data Entry Mode for .

.MODE_GET()

V5

Returns a number that indicates the current Data Entry Mode for.

.MOVE()

V6

Moves the record pointer forward or backwards (in the current sort order) a specified number of records.

.MOVE_RECORD_TO()

V5

Moves the current record in <TBL> to the target table.

.MOVE_RECORDS_TO()

V5

Moves records in <TBL> to the target table.

.NAME_GET()

V5

Returns the Alias of <TBL>.

.NAME_NORMALIZE()

V5

Returns the normalized version of a table or set name.

.NAME_REAL_GET()

V5

Returns the name of <TBL>.

.NEED_REFRESH()

V5

Returns .T. (TRUE) if the record in the record buffer for <TBL> needs to be refreshed.

.ORDER()

V5

Orders, and optionally filters, data from <TBL>.

.PACK()

V5

Packs the table referenced by <TBL>.

.PARENT_GET()

V5

Returns the Alias of <TBL>'s parent table in a set.

.PERSIST()

V5

Keeps <TBL> open after the end of a script so that a subsequent script can access the table without the overhead of having to open it again.

.POPULATE_FROM_STRING()

V6

Creates a table from a string variable.

.POPULATE_GRID()

V6

Populates arrays quickly with data from a table.

.POST()

V5

Replaces, adds, or subtracts field values in <TBL> using field values from a Transaction table.

.PREVIOUS_RECORD()

V5

Returns the record number that was current just before the user began entering a new record.

.QUERIES_REOPEN()

V5

Closes, and then reopens, <TBL>s .MPX files.

.QUERY_CREATE()

V5

Orders and selects data from <TBL>.

.QUERY_DETACH()

V5

Detaches the current or a named query.

.QUERY_DETACH_ALL()

V5

Detaches all temporary queries from <TBL>.

.QUERY_FROM_RANGE()

V5

Converts the current range into a query.

.QUERY_PRIMARY_PUT()

V5

Runs the saved query specified by Query_Name for <TBL>.

.RANGE_ADD()

V5

Applies a range to <TBL>.

.RANGE_DROP()

V5

Removes the active range for the table referenced by <TBL>

.RECALC_CALCFIELDS()

V5

Forces recalculation of calc fields on a form.

.RECNO()

V5

Returns the record number of the current record in <TBL>.

.RECORD_CLONE()

V5

Copies all the field values from the current record of <TBL>, and places them in the record buffer for the current record in the destination table.

.RECORD_DATA_GET()

V5

Copies all the field values from Record_Number (or the current record if Record_Number is not specified) to a blob variable.

.RECORD_DATA_SET()

V5

Copies all the field values from the blob variable, Record_Data, into the current record.

.RECORD_TO_VARS()

V6

Populates the Vars pointer variable with the values of the current record's fields.

.RECORDS_DELETED()

V5

Number_of_Deleted_Records in <TBL>.

.RECORDS_GET()

V5

Number_of_Records in <TBL>.

.REFERENCE_EXPRESSION_GET()

V5

Returns an Expression that generates a pointer to the table.

.REFRESH()

V5

Refreshes the data in the record buffer for the current record in <TBL>.

.RELATION_ADD()

V5

Establishes a relationship, or link, between two open tables.

.RELATION_CHANGE()

V5

Changes the definition of an existing relationship between two open tables.

.RELATION_DROP()

V5

Removes the link between parent <TBL> and a child table.

.RELATION_GET()

V5

Returns the type of relationship between <TBL> and it's parent table.

.RELATION_TAG()

V5

Builds an index and returns a handle for the index. It is used in conjunction with the <TBL>.RELATION_ADD() and <TBL>.RELATION_CHANGE() methods.

.RENAME()

V5

Changes the name of a <TBL>.

.RULES_GET()

V5

Returns a dot variable containing field rule information for the selected table.

.SESSIONHANDLE()

V5

Returns the handle associated with the table.

.SET_CREATE()

V5

Creates a set definition file from the relational links established by the <TBL>.RELATION_ADD() method.

.SUBTRACT()

V5

Creates a new table by merging the records from <TBL> with records from a Secondary table. The new table contains one record for each record in <TBL> that has no matching record in the Secondary table.

.SUMMARIZE()

V5

Summarizes the records of <TBL>, creating a new table to store the result.

.UNDELETE()

V5

Undeletes a range of records in <TBL>.

.UNMARK()

V5

Unmarks the current record.

.UNMARK_DUPS()

V5

Unmark duplicate records in <TBL>.

.UNMARK_RANGE()

V5

Unmark selected records in <TBL>.

.UPDATE()

V5

Updates the records of <TBL>.

.UPDATE_

PRODUCTION_INDEX()

V5

Updates all of the indexes in the production index of <TBL>.

.ZAP()

V5

Removes all records from <TBL>.

Alpha Five provides the following table functions.

Function

 

Description

A5_ADD_FIELDS_

TO_TABLE()

V5

Adds one or more new fields to an existing table.

A5_CHANGEFIELDSIZE()

V5

Changes the width and/or number of decimal places of a field in a table.

A5_CreatePassiveLinkTable()

V7

Creates a passive-link table.

A5_DUPLICATE_TABLE()

V5

Displays the Duplicate Table dialog box, which allows you to copy a table.

A5_FixDBFFieldNames()

V6

Ensures that all field names are valid, and fixes any that are not.

A5_ForceCloseTables()

V6

Closes all tables which do not have an open window.

A5_GET_FIELDNAMES()

V5

Lists field names from a table or set.

A5_PACK_DICTIONARY()

V5

Packs the data dictionary for a table, and rebuilds and updates indexes in the .DDX file if it is missing.

A5_PACK_TABLE()

V5

Packs a table.

A5_PassiveLinkTableDefine()

V7

Creates a passive-link table.

A5_RefreshPassiveLinkTable()

V7

Refreshes the contents of a passive-link table.

A5_TableSizeToFit_Dialog()

V6

Displays the Size Fields to Fit dialog, which allows you to resize the table's field to fit its data.

A5_ZAP_TABLE()

V5

Removes records from the named table but preserves the table structure.

BOF()

V5

Returns .T. if the record pointer is at the first record of the current table.

CHECK_INDEXES_

FOR_TABLE()

V5

Checks the integrity of the indexes of a table.

CREATE_TABLE()

V5

A high level Xbasic function to create a new table.

DBF()

V5

Returns the name of the current table.

EOF()

V5

Returns .T. if the record pointer is at the last record of the current table.

FILE_ADD_TO_DB()

V5

Adds a table to the Control Panel.

FILE_DROP_FROM_DB()

V5

Removes a table from the Control Panel.

FILES_IN_TABLE()

V5

Returns a CR-LF delimited character string list containing the fully qualified names of the components of the table.

STRIP_TABLE_PATHS()

V5

Returns the name of the table or set without path information.

TABLE()

V5

Returns the name of the current primary table.

TABLE_CHOOSER_ACTUAL()

V6

Returns the fully qualified name of a table file.

TABLE_IS_EMPTY()

V6

Determines whether a table contains any records.

TABLE_REMOVE()

V6

Removes a table file (.DBF) and its associated files.

TABLE_RESTRUCTURE()

V6

Takes a CR-LF delimited list of field specifications and restructures a table.

TABLEAVG()

V5

Searches the specified Lookup_Table for one or more records that satisfy the specified Filter, and returns the average of the values contained in the Lookup_Expression.

TABLECOUNT()

V5

Searches the specified Lookup_Table for one or more records that satisfy the specified Filter, and returns the number of records found.

TABLEMAX()

V5

Searches the specified Lookup_Table for one or more records that satisfy the specified Filter, and returns the largest of the values contained in the Lookup_Expression.

TABLEMIN()

V5

Searches the specified Lookup_Table for one or more records that satisfy the specified Filter, and returns the smallest of the values contained in the Lookup_Expression.

TABLES_IN_SET()

V5

Returns a CR-LF delimited list of files composing the set defined by Set_Name.

TABLESUM()

V5

Searches the specified Lookup_Table for one or more records that satisfy the specified Filter, and returns the sum of the values contained in the Lookup_Expression.

UI_GET_TABLE()

V5

Prompts the user for a table selection.

UI_PROMPT_NEW_TABLE()

V5

Displays the Specify Table Name dialog box, then returns the fully qualified name of the new table.

SearchTables()

V8

Displays the Search Selected Tables for Data Value dialog box. This dialog allows you to discover the names of the tables and of their fields that contain a specified value.

TableFinder()

V8

Displays the Table Finder dialog. Use this dialog to find tables that contain named fields.

See Also

Table Index Methods, Table Operation Methods