RefTable

See Also: RefClass, RefFunc, RefProc, RefProcSet

Purpose

Allows for a simpler way of referencing a table number or column number.

Return Type

Integer

Syntax

(RefTable( {TableName} ))

What it Does

This is a function that makes it easier to work with table numbers and table column numbers by their name.

Normally, a table number is referenced by Table.File_Number, and a Table.Column argument returns the value for that Table.Column argument. RefTable(Table) returns the table number of Table and RefTable(Table.Column) returns the column number of Column in Table.

For example:

Move (RefTable(Customer.Name)) to iColumn  // would return the column number (2)

If you don't pass the ".ColumnName", the Table number is returned

Move (RefTable(Customer)) to iTable  // would return the table number (25)

 

This means you don't have to use the Get_FieldNumber and Get_FileNumber commands, the ".File_Number" column literal or use the FILE and FILE_FIELD modifiers. Those all still work but RefTable() can be easier to use. RefTable() is supported by CodeSense and CodeComplete.

  

Example 1

Get_Attribute Field_Length of Customer.File_Number (RefTable(Customer.Name)) to iLength

<or>

Get_Attribute Field_Length of (RefTable(Customer)) (RefTable(Customer.Name)) to iLength

  

Example 2

Function Field_CommitNoEnterOnIndex Integer iField Returns Boolean

    Function_Return (RefTable(OrderHea.Order_Date)=iField)

End_Function

  

Example 3

Procedure ClearNamePrompt

    Set Prompt_Object of oCustomerDD  (RefTable(Customer.Name)) to 0

End_Function

Notes