I have the following code and getting an "Object doesn't support this method: 'ts.EOF'" error. It works fine without the loop, but i really need it to go through the whole file and it would never be the same number of records. I would appreciate if someone could give me some help.
Thanks in advance,
Kacy
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)
REM This line calls the macro subroutine
subSub1_
sub subSub1_()
autECLSession.autECLOIA.WaitForAppAvailable
Dim fso, f1, ts, s
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.CreateTextFile("c:\testfile.txt", True)
' Write a line.
f1.WriteLine "R99999999999"
f1.WriteLine "R99999999999"
' Read the contents of the file.
Set ts = fspenTextFile("c:\testfile.txt", ForReading)
Do While Not ts.EOF
s = ts.ReadLine
autECLSession.autECLPS.SendKeys "DLN/"+s+".PM1."
autECLSession.autECLPS.SendKeys"[Enter]"
autECLSession.autECLPS.SendKeys"[Clear]"
ts.MoveNext
Loop
ts.Close
end sub
Thanks in advance,
Kacy
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)
REM This line calls the macro subroutine
subSub1_
sub subSub1_()
autECLSession.autECLOIA.WaitForAppAvailable
Dim fso, f1, ts, s
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.CreateTextFile("c:\testfile.txt", True)
' Write a line.
f1.WriteLine "R99999999999"
f1.WriteLine "R99999999999"
' Read the contents of the file.
Set ts = fspenTextFile("c:\testfile.txt", ForReading)
Do While Not ts.EOF
s = ts.ReadLine
autECLSession.autECLPS.SendKeys "DLN/"+s+".PM1."
autECLSession.autECLPS.SendKeys"[Enter]"
autECLSession.autECLPS.SendKeys"[Clear]"
ts.MoveNext
Loop
ts.Close
end sub