EXPAND()

EXPAND()

Top  Previous  Next

 

The EXPAND() function merges a data collection with a linked item.

 

 

Format

 

EXPAND(link.item)

EXPAND(link.item, fvar)

 

where

 

link.itemis a reference to a data collection string element containing the link.

 

fvaris the file variable to be used when resolving a link that does not specify a filename.

 

 

A data collection stored in a collection file may contain links to other collections in the same file or a different file. The links are stored as a string variable that contains a reference to the linked item as

filename:id

The filename (but not the colon) can be omitted if the link is to a record in a default file (perhaps the same file) but this reduced syntax has implications for the application as described below. There is nothing about this string item that defines it as a link except for how it is used by the application.

 

Where a data collection containing a link has been read into a QMBasic variable, the linked item can be joined onto its parent by use of the EXPAND() function

OK = EXPAND(VAR{'link'})

where link is the element path of the string that defines the link.

 

If the link string uses the reduced syntax that has no filename, the extended form of the EXPAND() function must be used where fvar is a file variable that references the file containing the linked item. This optional function argument is ignored when using the full syntax of the link string.

 

The EXPAND() function returns True if successful.

 

 

See also:

Data collections