DiskChange Function | |
Change the current disk drive.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION DiskChange(
pszDrive AS PSZ
) AS LOGIC
public static bool DiskChange(
Psz pszDrive
)
Request Example
View SourceParameters
- pszDrive
- Type: Psz
The letter of the disk drive to change.
Return Value
Type:
Logic
TRUE if successful; otherwise, FALSE.
Remarks Examples
This example uses DiskChange() to change to drive D:
1IF DiskChange("D:")
2 ? "Successfully changed"
3ELSE
4 ? "Not changed"
5ENDIF
This example builds a string that contains all currently available drives on your systeO:
1FUNCTION AllDrives()
2 LOCAL wI AS DWORD
3 LOCAL cDrives AS STRING
4 cDrives := NULL_STRING
5 FOR wI := 1 UPTO 27
6 IF DiskChange(Chr(wI +64))
7 cDrives := cDrives + Chr(wI+64)
8 ENDIF
9 NEXT
10 RETURN cDrives
See Also