Floating default data file

Command groupFlag affectedReversibleExecute on clientPlatform(s)
Data filesNOYESNOAll

Syntax

Floating default data file
 
list-of-files 
(F1,F2,..,Fn)

Description

This command sets the default data file as the current data file and changes whenever the current data file changes. You use Floating default data file in libraries which open more than one data file at once. The default behavior in Omnis is that, as each new data file is opened, it becomes the "current" data file. The concept of a current data file is important when your commands refer to file classes without specifying a data file.

The Floating default data file command sets the default data file, for the specified list of files, to be equal to the current data file and allows it to change (float) whenever the current data file changes.

The command does not change the flag but is reversible, that is, the previous default data files are restored when the method containing the command in a reversible block terminates.

Example

# To specify the data file, you can use Set Default Data File to associate a file class with the

# current data file.  In this example we associate fCustomers with Data.df1

 
Set current data file
 
Data1

Set default data file
 
fCustomers

 
# References to fCustomers are now equivalent to references to Data1.fCustomers.

# The association between fCustomers and Data1 remains in effect even if the current data file

# is set to a different data file.  To return to the default state where the default data file "floats"

# to whatever the current data file is, you can use:

 
Floating default data file
 
fCustomers