table.RENAME Function

Syntax

V Rename(C Filename)

Arguments

Filename

The new name to be given to a table.

Description

Renames the table.

Discussion

The <TBL>.RENAME() method changes the name of an open table referenced by <TBL> to the specified Filename. The production index filename and the data dictionary filenames will also be renamed.

Example 

This script changes the name of the specified table. The renamed table is then opened.

filename = ui_get_file("Table to Rename","Tables(*.DBF)","","X")
if filename = "" then
    end
end if
newname = ui_get_file("Change name to:","Tables(*.DBF)","","N")
if newname = "" then
    end
end if
tbl = table.open(filename, FILE_RW_EXCLUSIVE)
tbl.rename(newname)
tbl.close()
tbl = table.open(newname)

See Also