When i am running this script i get error pls. help i am a new in vbscript.


Run embedded script...
W3602 : Error 0 on line 22, column 25: Microsoft VBScript runtime error: Input past end of file
W3603 : Error running script.
Run Script: W1603 : Plugin failed - 16:59:12

Script


Set g_fsObject = CreateObject("Scripting.FileSystemObject")
Set InputFile = g_fsObject.OpenTextFile(PW_GetJobFileName, 1)

temp_path = g_fsObject.GetFile(PW_GetJobFileName).ParentFolder.Path
temp_name = g_fsObject.GetTempName

Set outputfile = g_fsObject.GetFolder(temp_path).CreateTextFile(temp_name)

label_count = 1
line_count = 1
page_count = 0
l_continue = 1
first_time = 0
Line = inputfile.readline
Line = LTrim(Line)


Do
If Left(Line, 7) <> "99999SR" Then
' outputfile.writeline "Unable to process job"
l_continue = 0
Line = inputfile.readline
l_date = Mid(Line, 31, 11)
Line = Mid(Line, 5, 7)
Else
first_time = 1
line_count = 10
l_continue = 1
End If
Loop Until l_continue = 1

If l_continue = 1 Then
Do While Not inputfile.AtEndOfStream
Line = inputfile.readline
l_type = Mid(Line, 6, 2)
If line_count > 9 Then
page_count = page_count + 1
outputfile.writeline Chr(12)
outputfile.writeline "NEW SHEET " & l_date & " " & "PAGE # " & page_count
outputfile.writeline "Store # " & Mid(Line, 1, 5)
label_count = 1
line_count = 1
End If

Select Case l_type
Case " ":
outputfile.writeline line_count & " " & label_count & " " & Line
label_count = label_count + 1
If label_count > 4 Then
label_count = 1
line_count = line_count + 1
End If

Case "NR":
outputfile.writeline line_count & " " & label_count & " " & Line
label_count = label_count + 1
If label_count > 4 Then
label_count = 1
line_count = line_count + 1
End If

Case "NS":
If label_count > 1 Then
For t = label_count To 4
outputfile.writeline line_count & " " & t
Next
line_count = line_count + 1
End If
If line_count > 9 Then
page_count = page_count + 1
outputfile.writeline Chr(12)
outputfile.writeline "NEW SHEET " & l_date & " " & "PAGE # " & page_count
outputfile.writeline "Store # " & Mid(Line, 1, 5)
label_count = 1
line_count = 1
End If

outputfile.writeline line_count & " " & 1 & " " & Line
label_count = 2
page_count = 1

Case "ES":
If label_count > 1 Then
For t = label_count To 4
outputfile.writeline line_count & " " & t
Next
line_count = line_count + 1
End If
If line_count > 9 Then
page_count = page_count + 1
outputfile.writeline Chr(12)
outputfile.writeline "NEW SHEET " & l_date & " " & "PAGE # " & page_count
outputfile.writeline "Store # " & Mid(Line, 1, 5)
label_count = 1
line_count = 1
End If
outputfile.writeline line_count & " " & 1 & " " & Line
label_count = 2
page_count = 0
End Select
Loop
End If
inputfile.Close
outputfile.Close

g_fsObject.DeleteFile PW_GetJobFileName, true
g_fsObject.MoveFile temp_path+""+temp_name, PW_GetJobFileName