ErrorMessageTableName - DataDictionary

Returns the table name to be used when a DDO displays an error with a table name

Type: Function

Return Data Type: String

Parameters: Integer iTable

ParameterDescription
iTableThe table number


Return Value


Syntax
Function ErrorMessageTableName Integer iTable Returns String

Call: Get ErrorMessageTableName iTable to StringVariable


Description

ErrorMessageTableName is called any time a Data Dictionary error occurs, which will result in the user being presented with an error that contains the name of a table. By default, it just returns the table's logical name (DF_FILE_LOGICAL_NAME). You may wish to augment or override this to return a name that might have more meaning to an end user. The table number, which is almost always the Data Dictionary object's (DDO's) main table is passed as iTable.

Sample

In this example, assume that your DD's logical table name GL400r3 and you would like to present a more meaningful name in your errors:

Function ErrorMessageTableName Integer iTable Returns String
    String sTable
    Integer iMain

    Forward Get ErrorMessageTableName iTable to sTable
    Get Main_File to iMain
    If (iMain = iTable) Begin
        Move ("Checks [" + sTable + "]")  to sTable
    End
    Function_Return sTable
End_Function  


Note that the iTable being passed will be the Main_File of the DD. The exception is when an error occurs when checking Save and Delete structures, where the iTable passed will be the table number that is missing from the structure. When this happens, it almost always a programming error, which an end user should never see. That is why in the above example we only provide a friendly table name when the table number is the same as the DD's Main_File.