Click or drag to resize

DirChange Function

X#
Change the current Windows directory.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION DirChange(
	pszDir AS STRING
) AS LONG
Request Example View Source

Parameters

pszDir
Type: String
The name of the directory to change to, including the drive.

Return Value

Type: Long
0 if successful; -1 if there is an argument error; otherwise, the DOS error code.
Remarks
DirChange() changes the current subdirectory or determines if a directory exists. Be aware that if, after issuing a DirChange(), you change to another drive (via DiskChange(), for example), another Windows task might change the directory of the disk on which your original DirChange() was issued.
Examples
This example uses DirChange():
X#
1siError :=  DirChange("c:\dos")
2IF siError != 0
3    ? DOSErrString(siError)
4ENDIF
See Also