ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV, WEBDEV and WINDEV Mobile 2024 feature!
Help / WLanguage / WLanguage functions / Standard functions / External file functions / WLanguage procedures
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Parameters of the procedure used by fReadLine
WLanguage procedure ("Callback") called by fReadLine for each line read in the file. This procedure can be a local, global or internal procedure.
Example
// Declare the variables
FileNameAndPath is string
FileID is int
NumberLinesRead is int = 0

// Declaration of the WLanguage procedure
INTERNAL PROCÉDURE AnsiCallback(LineRead is ANSI string)
Trace("Callback | Line read: " + LineRead)
END

// Select the file name and path
FileNameAndPath = "C:\Directory\AnsiFile.txt"

// Open file
FileID = fOpen(FileNameAndPath, foAnsi)
// Display an error message if no file was opened
IF FileID = -1 THEN
Error(ErrorInfo(errMessage))
ELSE
// Read the lines of the file
NumberLinesRead = fReadLine(FileID, AnsiCallback)
IF ErrorOccurred THEN
Error(ErrorInfo())
END
Trace("Number of lines read: " + NumberLinesRead)
// Close the file
fClose(FileID)
Trace("Read operation completed")
END
Syntax
<Result> = fReadLine_Callback(<Row read>)
<Result>: Boolean
  • True if the line was read,
  • False otherwise.
<Row read>: Character string
Content of the line read in the file.
Component: wd290std.dll
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/02/2023

Send a report | Local help