[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

hughie

12/19/2006 1:48:00 PM

Having output text from a dos batch file, I read it back into a text
box on a userform thus:

Open fileName For Input As #1
Do While Not EOF(1)
Input #1, x
str = str & x & vbCrLf
Loop

...and then send 'str' back as the result of a function.

When the file has commas in it, the text box reads them as line breaks.
Does anyone know how to stop this?

tia,
Hughie

1 Answer

NickHK

12/20/2006 4:55:00 AM

0

Hughie,
Maybe getting the whole file in one go is suitable ?

Dim FileNum As Long
Dim FileStr As String

FileNum = FreeFile
Open "C:\Test.txt" For Input As FileNum
FileStr = Input$(LOF(FileNum), #FileNum)
Close #FileNum

Debug.Print FileStr

NickHK

"hughie" <hughie.carroll@gmail.com> wrote in message
news:1166536076.116393.62480@73g2000cwn.googlegroups.com...
> Having output text from a dos batch file, I read it back into a text
> box on a userform thus:
>
> Open fileName For Input As #1
> Do While Not EOF(1)
> Input #1, x
> str = str & x & vbCrLf
> Loop
>
> ..and then send 'str' back as the result of a function.
>
> When the file has commas in it, the text box reads them as line breaks.
> Does anyone know how to stop this?
>
> tia,
> Hughie
>