Question:
How can I return the contents of a specific line in a TXT file?
Solution:
To do so, you must use the methods in FileSystemObject objects.
Example:
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:\Test.txt", ForReading)
For i = 1 to Screen.Item("SetPoint").Value-1
f.ReadLine
Next
strLine = f.ReadLine
Screen.Item("Display").Value = strLine
f.Close
NOTE: If the number of the line selected in the SetPoint is higher than the number of lines in the file, a script error will be returned.