This is the following code I have:
Code:
<%
'Option Explicit
' Set up constants
Const ForReading = 1
Const Create = False
' Declare local variables
Dim objFSO ' FileSystemObject
Dim TS ' TextStreamObject
Dim strLine ' local variable to store Line
Dim strFileName ' local variable to store fileName
strFileName = Server.MapPath("/demo/DCI.txt")
' Instantiate the FileSystemObject
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim UserData()
' use Opentextfile Method to Open the text File
Set TS = objFSO.OpenTextFile(strFileName, ForReading, Create)
SectionNumber = 0
Do While Not TS.AtEndOfStream
Lines = Replace(Replace(TS.ReadLine,vbTab&vbTab,","),vbTab,",")
LineComp = Split(Lines,",",-1,1)
'Section (0) = Version of the DCI Program
If SectionNumber = 0 Then
ProgramVersion = LineComp(0)
End If
'Section(1) = Sanctioing Information
If SectionNumber = 1 Then
SanctioningNumber = LineComp(0)
CordnatorPin = LineComp(1)
HeadJudgePin = LineComp(2)
End If
'Section(3) = Players in the tournament
If SectionNumber = 2 Then
UserList = UserList & LineComp(1) & "," & LineComp(2) & "," & LineComp(3) & "|"
End If
If TS.ReadLine = "****" Then
SectionNumber = SectionNumber + 1
End If
Loop
%>
Click
http://www.topdeckcards.com/demo/dci.txt for the text file I am working with.
The problem is I am like skipping lines almost, and I get the following error on the line blue line about.
Microsoft VBScript runtime error '800a0009'
Subscript out of range: '[number: 2]'
/DCI.asp, line 42
If I dont set it to record LINECOMP(2) or greater it will display:
"1357****" and more stufff. PLEASE HELP