PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Closing an external file
  • Closing an external file (WINDEV Mobile)
Closing an external file
WINDEVWEBDEV - Server codeReports and QueriesJavaPHPAjaxUser code (UMC) The following code is used to close an external file. The file is opened in read/write mode. The opened file can be freely accessed by the other applications.
// Declare the variables
FileNameAndPath is string
FileID is int
ResCloseFile is int

// Select the file name and path
FileNameAndPath = "C:\MyDirectories\File.txt"

// Open the file
FileID = fOpen(FileNameAndPath, foReadWrite)

// Display an error message if the opening was not performed
IF FileID = -1 THEN
Error(ErrorInfo(errMessage))
ELSE
// Processes in the external file
...
// End of processes in the external file
// Close the file
ResCloseFile = fClose(FileID)
IF ResCloseFile = -1 THEN
// Display an error message if the closing was not performed
Error(ErrorInfo(errMessage))
END
END
Closing an external file (WINDEV Mobile)
Windows Mobile The following code is used to close an external file. The file is opened in read/write mode. The opened file can be freely accessed by the other applications.
// Declare the variables
FileNameAndPath is string = "\My Files\File.TXT"
FileID is int
ResCloseFile is int

// Open the file
FileID = fOpen(FileNameAndPath, foReadWrite)

// Display an error message if the opening was not performed
IF FileID = -1 THEN
Error(ErrorInfo(errMessage))
ELSE
// Processes in the external file
...
// End of processes in the external file // Close the file
ResCloseFile = fClose(FileID)
IF ResCloseFile = -1 THEN
  // Display an error message if the closing was not performed
  Error(ErrorInfo(errMessage))
END
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment