pgkWA‖

eHmCk‖ChDrive Statement

mdSba‖Changes the current drive.

warning

9njBT‖Some DOS-specific file and directory functions are no longer provided in LibreOfficeDev, or their function is only limited. For example, support for the ChDir, ChDrive and CurDir functions is not provided. Some DOS-specific properties are no longer used in functions that expect file properties as parameters (for example, to differentiate from concealed files and system files). This ensures the greatest possible level of platform independence for LibreOfficeDev. Therefore this feature is subject to removal in a future release.


note

e4feF‖The ScriptForge library in LibreOfficeDev 7.1 introduces the FileSystem service with methods to handle files and folders in user scripts.


FVEx2‖Syntax:


  ChDrive Text As String

WADQ4‖Parameters:

8AGkA‖ Text: Any string expression that contains the drive letter of the new drive. If you want, you can use URL notation.

WcKDC‖The drive must be assigned a capital letter. Under Windows, the letter that you assign the drive is restricted by the settings in LASTDRV. If the drive argument is a multiple-character string, only the first letter is relevant. If you attempt to access a non-existent drive, an error occurs that you can respond to with the OnError statement.

SEjHR‖Error codes:

5 Invalid procedure call

68 Device not available

76 Path not found

EFSA4‖Example:


  Sub ExampleChDrive
  qkLdV‖    ChDrive "D" ' Only possible if a drive 'D' exists.
  End Sub