file input

henszey
04-20-2003, 08:57 PM
i am using

Input #f, temp

to get some information out of a comma delimited file. the information is stored like this...


gServer1, 255.255.255.255


first time i do it i get "gServer1" the second time i do it i get "255.255" it always cuts off after the second peroid, any ideas?

alp0001
04-20-2003, 09:30 PM
Dim MyString1 As String, MyString2 As String, FileNumber As Integer
FileNumber = FreeFile

Open "some local file" For Input As #FileNumber
Do While Not EOF(FileNumber)
Input #1, MyString1, MyString2
Debug.Print MyString1 & " " & MyString2
Loop
Close #FileNumber

Robse
04-20-2003, 09:38 PM
I'm guessing you have temp padded to 8 characters,
that would explain this:

"gServer1"
" 255.255"

I would recommend reading the whole file into a string
variable padded with Space$(LOF(FileNum)) and then
splitting 1. at newlines 2. at commas

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum