Click or drag to resize

CurDrive Function

X#
Return the current Windows drive.

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

Return Value

Type: String
The letter of the current drive, without a trailing colon.
Remarks
Examples
This example illustrates the relationship between CurDrive() and DiskChange() and shows that CurDrive() is unaffected by SetDefault():
X#
1FUNCTION DriveTest()
2    ? CurDrive()            // C
3    SetDefault("A")
4    ? CurDrive()            // C
5    DiskChange("A")
6    ? CurDrive()            // A
7    DiskChange("C")
8    ? CurDrive()            // C
See Also