Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

vbscript synax error - please help

$
0
0

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



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>