Click to See Complete Forum and Search --> : Print# in VB


kjoter
October 17th, 2001, 04:41 AM
Hello, and thank you for good answers earlier.

I am using the print # function in VB, but having problems when i try to print to statements on the same line. My code looks like this:

Open PrintFile For Append As #1
sData = sData & fld.Name & ", "
Print #1, sData
aData = aData & fld.Address & ", "
Print #1, aData
Close#

When I do it this way, VB starts on a new line each time it does a print#. I want it to print on the same line, and just add it in the end of the line..

Thankful for all suggestions
K.

Clearcode
October 17th, 2001, 04:51 AM
If you add a semi-colon after the print statement, VB doesn't move on to the next line:


'\\ print 1 - 10 on the same line
for num = 1 to 10
print #1, Str$(num) & "," ;
next Num




HTH,
Duncan

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.

kjoter
October 17th, 2001, 05:25 AM
Thanks! Easy answer, but it helped me a lot!
K.