AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos externos
  • Example: Retrieve the file date information
  • Example: Modifying the creation date of a file
Example: Retrieve the file date information
WINDEVWEBDEV - Código ServidorReportes y ConsultasAjax The following code is used to find out the differents dates associated with a file.
// Declare the variables
ResCreationDate is string
ResModificationDate is string
ResAccessDate is string
FilePath is string
 
// Select a file
FilePath = "C:\MyDirectories\File.txt"
 
// Retrieve the file date information
ResCreationDate = fDate(FilePath, "", fCreation)
ResModificationDate = fDate(FilePath, "", fModify)
ResAccessDate = fDate(FilePath, "", fAccess)
IF ResCreationDate <> "" AND ResModificationDate <> "" AND ResAccessDate <> "" THEN
// Display the dates associated with the file
Info("The creation date is: " + ResCreationDate + CR + ...
"The modification date is: " + ResModificationDate + CR + ...
"The access date is: " + ResAccessDate)
ELSE
// Display an error message if the retrieval was not performed
Error(ErrorInfo(errMessage))
END
Example: Modifying the creation date of a file
WINDEVWEBDEV - Código ServidorReportes y ConsultasAjax The following code is used to modify the creation date of a file by the system date of the computer.
// Declare the variables
ResCreationDate is string
ResSystemDate is string
FilePath is string
 
// Select a file
FilePath = "C:\MyDirectories\File.txt"
 
// Retrieve the system date in YYYYMMDD format
ResSystemDate = DateSys()
// Modify the creation date of the selected file
ResCreationDate = fDate(FilePath, ResSystemDate, fCreation)
IF ResCreationDate <> "" THEN
// Display the creation date
Info("The creation date is now: " + ResCreationDate)
ELSE
// Display an error message if the retrieval was not performed
Error(ErrorInfo(errMessage))
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: 22/08/2022

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