AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos externos
  • Displaying in a List Box control the long names of the files found in a directory
fLongName (Example)
Displaying in a List Box control the long names of the files found in a directory
WINDEVReportes y ConsultasCódigo de Usuario (UMC) The following code is used to:
  • store in an array the name of the files found in a directory (ArrayPath),
  • display in a List Box control the long names of the files found in a directory (LIST_ListLongName)
// Declare and initialize the variables
PathDirFile is string
ResLongName is string
ArrIndex is int = 0 // Index of the array
LoopSubscript is int
ArrayPath is array
 
// Retrieve the first file found in the directory
PathDirFile = fDir("C:\MyDirectories\*.*", frFile)
WHILE PathDirFile <> "" THEN
// Increment the array subscript
ArrSubscript++
// Include the names of the files in the array
ArrayPath[ArrSubscript] = PathDirFile
// Retrieve the next file
PathDirFile = fDir("")
END
FOR LoopSubscript = 1 TO ArrSubscript
// Retrieve the long name
ResLongName = fLongName(ArrayPath[LoopSubscript])
IF ResLongName = "" THEN
// Display an error message if the retrieval was not performed
Error(ErrorInfo(errMessage))
ELSE
// Display long name in a List Box control
ListAdd(LIST_ListLongName, ResLongName)
END
END
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 06/04/2023

Señalar un error o enviar una sugerencia | Ayuda local