
October 30th, 2004, 10:31 AM
|
|
Registered User
|
|
Join Date: Sep 2004
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Split Function
This is my code, and the line that is in red is the line i think that is not working. It is not splitting the variable's string. One of the strings is "1 53868567 Grant 3453245" and whenever the BLUE line of code below is run I get a error telling me that the array(1) does not exsit.
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")
' use Opentextfile Method to Open the text File
Set TS = objFSO.OpenTextFile(strFileName, ForReading, Create)
If Not TS.AtEndOfStream Then
Do While Not TS.AtendOfStream
TempUser = TS.ReadLine
UserInfo = Split(TempUser," ")
Loop
End If
Response.Write UserInfo(1) & "<BR>"
TS.Close
Set TS = Nothing
Set objFSO = Nothing
%>
|