ChDir 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:


ChDir ВСкст As String

Parameters:

ВСкст. Π›ΡŽΠ±ΠΎΠ΅ строковоС Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅, ΠΊΠΎΡ‚ΠΎΡ€ΠΎΠ΅ ΡƒΠΊΠ°Π·Ρ‹Π²Π°Π΅Ρ‚ ΠΏΡƒΡ‚ΡŒ ΠΊ ΠΏΠ°ΠΏΠΊΠ΅ ΠΈΠ»ΠΈ диск.

Π—Π½Π°Ρ‡ΠΎΠΊ примСчания

Если Π½ΡƒΠΆΠ½ΠΎ ΠΈΠ·ΠΌΠ΅Π½ΠΈΡ‚ΡŒ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Ρ‚Π΅ΠΊΡƒΡ‰ΠΈΠΉ диск, ΡƒΠΊΠ°ΠΆΠΈΡ‚Π΅ Π±ΡƒΠΊΠ²Ρƒ этого диска с ΠΏΠΎΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΌ Π΄Π²ΠΎΠ΅Ρ‚ΠΎΡ‡ΠΈΠ΅ΠΌ.


Error codes:

5 ΠΠ΅ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½Ρ‹ΠΉ Π²Ρ‹Π·ΠΎΠ² ΠΏΡ€ΠΎΡ†Π΅Π΄ΡƒΡ€Ρ‹

76 ΠŸΡƒΡ‚ΡŒ Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½

Example:


  Sub ExampleChDir
      Dim sDir1 As String, sDir2 As String
      sDir1 = "C:\Test"
      sDir2 = "D:\Private"
      ChDir( sDir1 )
      MsgBox CurDir
      ChDir( sDir2 )
      MsgBox CurDir
  End Sub