PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Opening a selected file
fGraphicFilter (Example)
Opening a selected file
Reports and Queries The following code is used to open a file. This file is an image file or a text file. This file is selected by fSelect.
// Declare the variables
FileNameAndPath is string
ListImageFiles is string
FileID is int

// Retrieve the list of image formats supported by WINDEV
ListImageFiles = fGraphicFilter()

// Select the file to open
FileNameAndPath = fSelect("", "File.txt", "Select a file", ...
ListImageFiles + CR + "Text file (*.TXT)" + TAB + "*.txt", "TXT", ...
fselOpen + fselExist)

// 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 opened file
...
// End of processes
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment