TABLE.CREATE_SHADOW Function

Syntax

C Create_Shadow(C Shadowfilename,C ActualFilename[,L shadow_associated_files])

Arguments

Shadowfilename

The name to give to the new shadow copy of the table or set.

ActualFilename

The name of the table or set being shadowed.

shadow_associated_files

Optional

.T. = If you are creating a shadow for a set, then all of the tables in the set are shadowed as well.
.F. = If you are creating a shadow for a set, then only the primary table is shadowed.

Description

Create a shadow table - the shadowfilename is the table created, it points to the actualfilename.

Discussion

The TABLE.CREATE_SHADOW() method creates a shadow table or set that points to a physical table or set. The implication of this command is important in situations where you have Forms, Reports, etc. that you want to use with different tables, or sets (all of which have the same structure), because it allows you to build your Forms and Reports for the "shadow" table or set, and then just dynamically point the shadow to the physical table of set that you want to use.

Example

tfn = table.filename_get("a1")
sfn = "c:\data\shadow_a1.DBF"
'create a shadow table called 'shadow_a1' that points to the physical table 'a1'
table.create_shadow(sfn, tfn)
file_add_to_db(sfn)
t2fn = table.filename_get("a2")
table.create_shadow(sfn, t2fn)
'now the same shadow table 'shadow_a1' points to the physical table 'a2'.

See Also