-
Printing to file without line feed
Hi!
When I do like this:
Print #1, "Text" '#1 is my file
the program puts the word "text" on a new line
in a given file. But how do I append the text
on the same line as the last time?
I know I could be saving all the text in a variable,
and then print it to the file, but believe me,
that doesn't work for me in this situation.
Please, any suggestions?
-
Re: Printing to file without line feed
Hi John,
>But how do I append the text on the same line as the last time?
If you type:
Print #1, "Text1";
Print #1, "Text2"
"Text2" will follow "Text1" in the file, without any line breaks in
between. Notice the semicolon on the first line.
Mattias
__________________________________________________
Mattias Sjögren (MCP) - mattiass @ hem.passagen.se
VB+ http://hem.spray.se/mattias.sjogren/
Please send questions/replies to the newsgroups
-
Re: Printing to file without line feed
>When I do like this:
>Print #1, "Text" '#1 is my file
>
>the program puts the word "text" on a new line
>in a given file. But how do I append the text
>on the same line as the last time?
Do this:
Print #1, "Text"; 'note the semicolon
'the semicolon prevents vb from inserting a carriage return & line feed
-
Re: Printing to file without line feed
"Robert Gelb" <Robert.Gelb-nospam@db.com> wrote:
>
>>When I do like this:
>>Print #1, "Text" '#1 is my file
>>
>>the program puts the word "text" on a new line
>>in a given file. But how do I append the text
>>on the same line as the last time?
>
>Do this:
>
>Print #1, "Text"; 'note the semicolon
>
>'the semicolon prevents vb from inserting a carriage return & line feed
>
>
>
You may want to read the line of text into a variable, then combine the new
text to the end of the old. Finally, write the new string out with the print
statement.
I.E
Line Input oldString
Print #1, oldstring & "New Text";
Hope you get the idea?!?
Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks