Skip to content

DF_FILE_LOGICAL_NAME

See Also: Get_Attribute, Set_Attribute, DF_FILE_PHYSICAL_NAME

The logical file name stored in the file list for the table.

Level

Table

Supported by

All Drivers

Type

String, permanent

Access

Read / Write

Values

The logical name. Valid characters are A-Z, a-z, 0-9, #, and _ (underscore).

Remarks

The logical name can contain alphanumeric characters as well as ASCII characters above 32 and be up to 31 characters long. The logical name is the name used in the source code to identify a table.

Unlike other permanent table-level attributes, the filelist attributes (DF_FILE_DISPLAY_NAME, DF_FILE_ROOT_NAME, and DF_FILE_LOGICAL_NAME) can be set outside of a Structure_Start ... Structure_End operation. These attributes are actually stored in the filelist and not in the database or table.

To add a table to an existing filelist, the three filelist attributes must be set at the same time. To remove a table from the filelist, the three filelist attributes must be set to an empty string.

Sample Procedures

ShowFilelistNames

Procedure ShowFilelistNames
    Handle hTable
    String sRoot sDisplay sTable
    Move 0 to hTable
    Repeat
        Get_Attribute DF_FILE_NEXT_USED of hTable to hTable
        If (hTable <> 0) Begin
            Get_Attribute DF_FILE_ROOT_NAME of hTable to sRoot
            Get_Attribute DF_FILE_DISPLAY_NAME of hTable to sDisplay
            Get_Attribute DF_FILE_LOGICAL_NAME of hTable to sTable
            Showln hTable ", " sRoot ", " sDisplay ", " sTable
        End
    Until (hTable = 0)
End_Procedure

The sample procedure above shows all the filelist attributes.

NewEntry

Procedure NewEntry Handle hTable String sRoot String sDisplay String sTable
    Set_Attribute DF_FILE_ROOT_NAME of hTable to sRoot
    Set_Attribute DF_FILE_DISPLAY_NAME of hTable to sDisplay
    Set_Attribute DF_FILE_LOGICAL_NAME of hTable to sTable
End_Procedure

The sample procedure above creates a new filelist entry at a given slot. It can also be used to remove a filelist entry by passing empty strings for the three filelist attributes.

CreateNewFilelist

Procedure CreateNewFilelist String sNewList
    Handle hoWorkspace
    String sPath
    Integer iMaxSlots
    //*** Make sure new filelist goes into the first folder of datapath
    Get phoWorkspace of ghoApplication to hoWorkspace
    Get psDataPath of hoWorkspace to sPath
    Get PathAtIndex of hoWorkspace sPath 1 to sPath
    If (Right(sPath, 1) <> Sysconf(Sysconf_Dir_Separator)) ;
        Move (sPath - Sysconf(Sysconf_Dir_Separator)) to sPath
    Move (sPath - sNewList) to sPath
    //*** Create the disk file
    Direct_Output sPath
    Write "filelist.cfg"
    Close_output
    //*** Use the disk file as filelist
    Set_attribute DF_FILELIST_NAME to sPath
    //*** Create all the slots
    Get_Attribute DF_NUMBER_FILES_SUPPORTED to iMaxSlots
    Send NewEntry iMaxSlots "" "" ""
End_Procedure

The sample procedure above uses the filelist attributes to create a new empty filelist. It calls the NewEntry procedure defined above.