ChDrive utasítás

Megváltoztatja az aktuális meghajtót.

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.


Szintaxis:


  ChDrive Text As String

Paraméterek:

Szöveg: String (karakterlánc) kifejezés, amely az új meghajtó betűjelét tartalmazza. Igény szerint használhatja az URL-jelölést is.

A meghajtóhoz nagybetűt kell rendelni. Windows rendszeren a meghajtóhoz rendelt betűjelet a LASTDRV beállításai korlátozzák. Ha a meghajtóargumentum több karakterből áll, akkor a program csak az első betűt veszi figyelembe. Ha egy nem létező meghajtót próbál meg elérni, akkor hiba történik, amelyet az OnError utasítással lehet kezelni.

Hibakódok:

5 Érvénytelen eljáráshívás

68 Az eszköz nem érhető el

76 Az elérési út nem található

Példa:


  Sub ExampleChDrive
      ChDrive "D" ' Csak akkor lehetséges, ha a „D” meghajtó létezik.
  End Sub

Támogasson minket!