You are here: Function Reference > Alphabetical Listing > T > Table

Table

Use this procedure/function to look up and return a value from a standard table.

Syntax

Table (RetCode, Key, Table, File)

Parameter

Description

RetCode

Enter a return code value designated by the letters K and D. For example:

K - key code
D - code description
K + D - key code and code description
D + K - code description and key code

The default is the value of the current field table return value.

Key

Enter the table key code. The default is the value of the current field text.

Table

Enter the name of the table you want to search. Note that this parameter is case sensitive. The default is the current field table.

File

Enter the name of the file that contains the table you specified in the Table parameter. Note that this parameter is not case sensitive. The default is the value of current field table file name, or the current section table file name.

This procedure makes sure a given value (Key) is an entry in the specified table (Table). This procedure returns the string value identified in the RetCode parameter.

The table name in the Table parameter and file name in the File parameter must conform to the naming conventions used for naming tables in Studio. If the Key parameter does not occur within the named table, the return string is empty.

You can include one of these INI options to specify that entry table files will use the old or new format. (Do not include both options.)

< Tables >
OldFormatOnly = Yes
NewFormatOnly = Yes

For instance, if you are doing a lot of entry table lookups from the DAL code, your tables are located on a network drive, and the tables are a mix of both old and new format tables, performance can be affected because the system has to check the format of each table.

If, however, you can use one of these new options to tell the system that all tables are in the same format, it can omit that query and performance improves.

Specify only the option that applies. If you omit both options, the system first checks to see if the table is in the new format. If not, then it checks to see if the table is in the old format.

Keep in mind that if you include one of these options, all of your tables must be in that format. For instance if you set the OldFormatOnly option to Yes, all of your tables must be in the old format. If you later decide to convert your tables to the new format, you must remove this option and, to get the same performance gain, include the NewFormatOnly option.

Example

Here are some examples:

Procedure

Result

Explanation

Table ("D", "GA", "STATCOD", "table1")

Georgia

Verifies that a table named STATCOD is contained in the file named table1. Then returns the description (Georgia) for the key code GA.

See also