table.SET_CREATE Function

Syntax

V Set_Create(C Filename)

Arguments

Filename

The name of a new set to be created.

Description

Use the current table to define a new set of provided filename.

Discussion

The <TBL>.SET_CREATE() method creates a set definition file from the relational links established by the <TBL>.RELATION_ADD() method. Once you create the set definition, you can open it with the TABLE.OPEN() method and modify it with the Set Editor. <TBL> references the primary table of the set.

Example 

This script opens the invoice header and line items tables, links them together, and then saves the relation as a set.

dim parent as P
dim child_tbl as P
dim child_index as P
parent = table.open("c:\a5\a_sports\inv_head.dbf")
child_tbl = table.open("c:\a5\a_sports\inv_item.dbf")
relation.link_type = LINK_MANY
child_index = child_tbl.index_get("inv_no")
relation.index_child = child_index
relation.order_parent = "inv_no"
relation.ref_integrity = 1
parent.relation_add(child_tbl)
parent.set_create("c:\a5\a_sports\myset.set")

See Also