CurDir Function | |
Return the current Windows directory.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION CurDir() AS STRING
public static string CurDir()
Request Example
View SourceReturn Value
Type:
String
The current directory of the drive specified by
cDrive, without either leading or trailing backslash (\) characters.
If an error occurs, or the current directory of the specified drive is the root directory, CurDir() returns a NULL_STRING.
Please note that another Windows task might change the current directory of a non-default drive, thereby affecting the return value of CurDir() when it is used to query non-default drives.
Remarks Examples
These examples illustrate various CurDir() results:
1? CurDir("e:")
2? CurDir("c")
3? CurDir("c:")
4? CurDir()
5? CurDir("a")
This example changes the current Windows directory to a new value if it does not match a specified directory:
1IF CurDir("c:") != "vo\source"
2 DirChange("\vo\source")
3ENDIF
See Also