PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example: Retrieving the different dates associated with a file
  • Example: Modifying the creation date of a file
  • Example: Retrieve the different dates associated with a file (WINDEV Mobile)
  • Example 2: Modifying the creation date of a file (WINDEV Mobile)
Example: Retrieving the different dates associated with a file
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC) 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 different dates associated with a file
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 - Server codeReports and QueriesAjaxUser code (UMC) 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
Example: Retrieve the different dates associated with a file (WINDEV Mobile)
Windows Mobile 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 = "\My Files\File.TXT"

// Retrieve the different dates associated with a file
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 2: Modifying the creation date of a file (WINDEV Mobile)
Windows Mobile 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 = "\My Files\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
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment