Good Day,
I've been asked to execute the following lines of code from a book I'm using an i'm getting the following error. Btw I'm not a code guy so this is probably easily resolvable but if i knew I wouldn't be asking. Please assist if you can :) thanks in advance.
The test run cannot continue due to a syntax error
Expected end of statement
Line (2): "var ForReading = 1:"
code is as follows:
Dim fso, ts
var ForReading = 1;
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("C:\test.txt",ForReading,True)
Do Until ts.AtEndOfStream
s = ts.ReadLine
msgbox s
Loop
ts.Close
Set fso = Nothing
Set ts = Nothing