This code will let you write to a file without an extra linefeed being saved. It uses the Print # S
This code will let you write to a file without an extra linefeed being saved. It uses the Print # Statement.
API Declarations
'Put a text box on your form named "Text1"
'Put two command buttons on your form named "Command1" and "Command2"
Rate This code will let you write to a file without an extra linefeed being saved. It uses the Print # S
(1(1 Vote))
Command1.Caption = "Normal"
Command2.Caption = "Enhanced"
End Sub
Private Sub Command1_Click()
'This code will save a file normally, with
'the extra line at the end.
Open "C:\Test.txt" For Output As #1
Print #1, Text1.Text
Close #1
End Sub
Private Sub Command2_Click()
'This code will save a file without
'an extra line at the end. Please note
'the ";" after "Text1.Text" this is the
'trick. It will make the next printing
'position directly after the end of the
'string. BUT, since we aren't going to
'print anything else...
Open "C:\Test.txt" For Output As #1
Print #1, Text1.Text;
Close #1
End Sub
This code will let you write to a file without an extra linefeed being saved. It uses the Print # S Comments
No comments yet — be the first to post one!
Post a Comment