SetDefault Function (String) | |
Change the setting that determines the X# default drive and directory.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax FUNCTION SetDefault(
cPathSpec AS STRING
) AS STRING
public static string SetDefault(
string cPathSpec
)
Request Example
View SourceParameters
- cPathSpec
- Type: String
The default disk drive and directory.
If you specify both a drive and directory, a colon must be included after the drive letter. (Use GetDefault() to get the current setting.)
Return Value
Type:
StringRemarks
By default, when a X# program starts, the default drive and directory are the current X# drive and directory. Within the program, you can change this with SetDefault() — it sets the drive and directory where the application program creates and searches for files specified without a path name.
Note: Certain commands and functions that open files do not respect the SetDefault() setting.
These cases are noted explicitly in the documentation for those commands and functions.
SetDefault() does not change the X# drive and directory, but instead causes the application to use a different default.
To set additional search paths for file access, use SetPath().
Examples
This example uses SetDefault() to set and query the current default drive and directory:
1FUNCTION Start()
2? GetCurPath()
3SetPath("c:\")
4? GetCurPath()
5? GetDefault()
6SetDefault("c:\")
7? GetDefault()
8WAIT
See Also