Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing blank lines from text boxes

Status
Not open for further replies.

wrighty43

Programmer
Aug 4, 2004
13
GB
hi, i am haveing trouble with my most recent program

when the program starts it adds a user inputted variable to a text box, which tranfers it to a list in a rich text box, which in turn saves it to a rtf file. the problem i has is that when the program has finished it needs to delete this variable from the .rtf file BUT the problem i am having is i am replacing the variable with "" and then getting it to run the same places as before, the problem with this technique is that it leaves a blank line which seperates any pervious data in the file from any new data.

i need a way to remove these blank lines so it will either not be saved as a blank line, or when the information is opened from the file the blank lines are not shown in the text boxes.

thnx in advance for your help
 
If you have blank lines, try replacing instances of two vbcrlf with just one. This would need to be a recusrive function which would be called until there were none found.
 
How many lines are in these RTF files. If it's less than 100, I would suggest re-writting the file every time. If not then use Binary mode.

Casper

There is room for all of gods creatures, "Right Beside the Mashed Potatoes".
 
thnx for ur advice but i found another way to do it. after i has replaced the text with "" i moved the insertion point up so that it would write on the now blank line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top