PC Review


Reply
 
 
hughie
Guest
Posts: n/a
 
      19th Dec 2006
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

 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      20th Dec 2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
hughie
Guest
Posts: n/a
 
      21st Dec 2006
> Try
>
> line input #1, x
>
> and thatshould read lines.


yup!

thanks very much,
Hughie

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
delimiter Curtiss Greer Microsoft Access 4 11th May 2008 04:29 PM
Please define field delimiter and record delimiter in sorting A-Z. =?Utf-8?B?YW5nZWxmYWNl?= Microsoft Word Document Management 2 4th Oct 2004 10:43 PM
Use delimiter Grey Microsoft C# .NET 0 10th Mar 2004 03:27 AM
= As Delimiter Barney Microsoft Windows 2000 CMD Promt 1 14th Jan 2004 04:50 PM
Delimiter Tony Microsoft Access Queries 1 21st Jul 2003 03:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:11 PM.