ChDrive Statement

ChDrive-lause vaihtaa käsiteltävän levyaseman.

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.


Syntaksi:


  ChDrive Text As String

Parametrit:

Teksti1: merkkijonolause, jossa on uuden levyn asemakirjan. Tarvittaessa voidaan käyttää URL-esitysmuotoa.

Levyaseman tunnuksena pitää käyttää isoa kirjainta. Windowsissa kirjainten käyttöä rajoittaa LASTDRV-asetus. Jos levyaseman tunnus on monimerkkinen jono, vain ensimmäistä merkkiä käytetään. Yritykset käyttää levyasemaa, jota ei ole, johtaa virheeseen, joka on käsiteltävissä OnError-lauseella.

Virhekoodit:

5 Virheellinen proseduurikutsu

68 Laite ei ole käytettävissä

76 Polkua ei löydy

Esimerkki:


  Sub ExampleChDrive
      ChDrive "D" ' Toimii vain, jos asema 'D' on olemassa.
  End Sub

Please support us!