ChDrive Statement

āĻŦāĻ°ā§āϤāĻŽāĻžāύ āĻĄā§āϰāĻžāχāĻ­āϟāĻŋ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻ•āϰāĻž āĻšā§ŸāĨ¤

warning

Some DOS-specific file and directory functions are no longer provided in LibreOffice, 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 LibreOffice. Therefore this feature is subject to removal in a future release.


note

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


Syntax:


  ChDrive Text As String

Parameters:

āĻĒāĻžāĻ ā§āϝ: āύāϤ⧁āύ āĻĄā§āϰāĻžāχāϭ⧇āϰ āĻĄā§āϰāĻžāχāĻ­ āύāĻŋāĻ°ā§āĻĻ⧇āĻļāĻ• āĻŦāĻ°ā§āĻŖ āĻŦāĻŋāĻļāĻŋāĻˇā§āϟ āϝ⧇āϕ⧋āύ⧋ āĻ¸ā§āĻŸā§āϰāĻŋāĻ‚ āĻāĻ•ā§āϏāĻĒā§āϰ⧇āĻļāύāĨ¤ āφāĻĒāύāĻŋ āϚāĻžāχāϞ⧇ URL āύ⧋āĻŸā§‡āĻļāύ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāϤ⧇ āĻĒāĻžāϰ⧇āύāĨ¤

āĻĄā§āϰāĻžāχāĻ­āϟāĻŋ āĻ…āĻŦāĻļā§āϝāχ āĻŦ⧜ āĻšāĻžāϤ⧇āϰ āĻ…āĻ•ā§āώāϰ āĻšāĻŋāϏ⧇āĻŦ⧇ āĻĒā§āĻ°ā§Ÿā§‹āĻ— āĻ•āϰāĻž āĻšāĻŦ⧇āĨ¤ āωāχāĻ¨ā§āĻĄā§‹āĻœā§‡āϰ āĻ…āϧ⧀āύ⧇, āĻĄā§āϰāĻžāχāϭ⧇āϰ āϜāĻ¨ā§āϝ āφāĻĒāύāĻŋ āϝ⧇ āĻ…āĻ•ā§āώāϰ āĻŦāϰāĻžāĻĻā§āĻĻ āĻ•āϰ⧇āĻ›āĻŋāϞ⧇āύ āϤāĻž LASTDRV āĻāϰ āϏ⧇āϟāĻŋāĻ‚ āĻĻā§āĻŦāĻžāϰāĻž āϏ⧀āĻŽāĻžāĻŦāĻĻā§āϧ āĻĨāĻžāĻ•āĻŦ⧇āĨ¤ āϝāĻĻāĻŋ āĻĄā§āϰāĻžāχāĻ­ āφāϰāϗ⧁āĻŽā§‡āĻ¨ā§āϟāϟāĻŋ āĻāĻ•āĻžāϧāĻŋāĻ• āĻ…āĻ•ā§āώāϰāϝ⧁āĻ•ā§āϤ āĻ¸ā§āĻŸā§āϰāĻŋāĻ‚ āĻšā§Ÿ āϤāĻžāĻšāϞ⧇, āĻļ⧁āϧ⧁āĻŽāĻžāĻ¤ā§āϰ āĻĒā§āϰāĻĨāĻŽ āĻ…āĻ•ā§āώāϰāϟāĻŋ āĻĒā§āϰāĻžāϏāĻ™ā§āĻ—āĻŋāĻ• āĻšāĻŦ⧇āĨ¤ āφāĻĒāύāĻŋ āϝāĻĻāĻŋ āĻŦāĻŋāĻĻā§āϝāĻŽāĻžāύ āύ⧟ āĻāĻŽāύ āĻāĻ•āϟāĻŋ āĻĄā§āϰāĻžāχāĻ­ āĻĒā§āĻ°ā§Ÿā§‹āĻ— āĻ•āϰāϤ⧇ āϚāĻžāύ āϤāĻžāĻšāϞ⧇ āĻāĻ•āϟāĻŋ āĻ¤ā§āϰ⧁āϟāĻŋ āϏāĻ‚āϘāϟāĻŋāϤ āĻšāĻŦ⧇ āϝāĻž OnError āĻ¸ā§āĻŸā§‡āϟāĻŽā§‡āĻ¨ā§āĻŸā§‡āϰ āĻŽāĻžāĻ§ā§āϝāĻŽā§‡ āĻœā§āĻžāĻžāĻĒāύ āĻ•āϰāϤ⧇ āĻĒāĻžāϰ⧇āύāĨ¤

Error codes:

5 Invalid procedure call

68 Device not available 68 Device not available

76 Path not found 76 Path not found 76 Path not found

Example:


  Sub ExampleChDrive
      ChDrive "D" REM āϏāĻŽā§āĻ­āĻŦ āϝāĻĻāĻŋ āĻļ⧁āϧ⧁āĻŽāĻžāĻ¤ā§āϰ 'D' āωāĻĒāĻ¸ā§āĻĨāĻŋāϤ āĻĨāĻžāϕ⧇āĨ¤
  End Sub

Please support us!