Función CurDir

Returns a variant string that represents the current path .

Icono de aviso

Algunas funciones de archivos y directorios específicas de DOS ya no están disponibles en LibreOffice, o su funcionalidad es limitada. Por ejemplo, no se ofrece compatibilidad con las funciones ChDir, ChDrive y CurDir. Algunas propiedades específicas de DOS ya no se utilizan en funciones que esperan propiedades de archivo como parámetros (por ejemplo, para diferenciar entre archivos ocultos y archivos de sistema). Esto garantiza el mayor nivel posible de independencia de plataforma para LibreOffice. Por lo tanto, esta prestación está sujeta a eliminación en una versión futura.


Icono de nota

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


Sintaxis:


CurDir [(Text As String)]

Valor de retorno:

Cadena

Parámetros:

Text: Any string expression that specifies an existing drive, for example "C" for the first partition of the first hard drive. This parameter is used solely under Windows.

If no drive is specified or if the drive is a zero-length string (""), CurDir returns the path for the current drive. LibreOffice Basic reports an error if the syntax of the drive description is incorrect or if the drive does not exist.

Esta función no distingue entre mayúsculas y minúsculas.

Códigos de error:

5 Llamada a procedimiento no válida

68 Dispositivo no disponible

7 Memoria agotada

51 Error interno

Ejemplo:


  Sub ExampleCurDir
      Dim sDir1 As String, sDir2 As String
      sDir1 = "C:\Test"
      sDir2 = "D:\Private"
      ChDir( sDir1 )
      MsgBox CurDir
      ChDir( sDir2 )
      MsgBox CurDir
  End Sub
¡Necesitamos su ayuda!

¡Necesitamos su ayuda!