ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
WINDEVJavaUser code (UMC) Closing an external file
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 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

Last update: 08/25/2022

Send a report | Local help