xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

SET DEFAULT

Sets the default drive and directory.

Syntax

SET DEFAULT TO [<cPath>]

Arguments

TO <cPath>
The <cPath> parameter specifies the default drive and directory for an xHarbour application to create and/or open files. Directories are separated by backslashes and the drive letter is separated with a colon. <cPath> can be specified as a literal path or as a character expression enclosed in parentheses.

If <cPath> is omitted, the current drive and directory of the operating system is used as default directory

Description

The SET DEFAULT command specifies the drive and directory where the application creates and saves files. The initial value of <cPath> is the directory from where the xHarbour application is started.

Use the SET PATH command to add additional directories to be searched for files.

Note:  The SET DEFAULT command does not change the default directory of the operating system.

Info

See also:CurDir(), DefPath(), File(), Set(), SET PATH
Category: SET commands
Source:rtl\set.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates the effect of changing the default
// drectory of an xHabour application.

   PROCEDURE Main
      SET PATH TO
      ? File( "Customer.dbf" )         // Result: .F.

      SET DEFAULT TO C:\xhb\data
      ? File( "Customer.dbf" )         // Result: .T.

      SET DEFAULT TO C:                // define default drive
      SET DEFAULT TO ..                // Change to parent directory
      SET DEFAULT TO \                 // Change to root directory

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe