Command SET DEFAULT Foundation

Specifies the default drive and path for an Xbase++ application.

Syntax
SET DEFAULT TO [<cPath>]
Scope
thread-local
Parameters
<cPath>
The expression <cPath> specifies the default drive and the default path for an Xbase++ application. It can be specified as a literal or as a character expression in parentheses. When no argument is included, the current directory is used by default.
Description

The command SET DEFAULT specifies the drive and the path where an Xbase++ application searches for files and saves data by default. An exception is files which are managed using the low level file functions. The complete file name, including drive and path, must always be specified for these functions.

The initial value for SET DEFAULT is the directory in which the Xbase++ program is started. An Xbase++ application first searches for data files in the SET DEFAULT path and then in the directories which are specified using SET PATH.

Examples
SET DEFAULT
// The example demonstrates possible uses of 
// SET DEFAULT. 

PROCEDURE Main 

   SET PATH TO 
   ? File("CUSTOMER.DBF")         // result: .F. 

   SET DEFAULT TO d:\xpp\data\misc 
   ? File("CUSTOMER.DBF")         // result: .T. 

   SET DEFAULT TO ..              // select parent directory 

   SET DEFAULT TO \               // root directory is default 
   SET DEFAULT TO C:              // set default drive 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.