3 Replies - 225 Views - Last Post: 05 February 2012 - 05:35 PM Rate Topic: -----

Topic Sponsor:

#1 sangwa125  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 05-February 12

how to make newlines in textfile

Posted 05 February 2012 - 01:30 PM

i want to make a simple database but that at each
time i press a save button my saved textfile
get added the new data but the point is to first make like
3 lines i mean spaces
Is This A Good Question/Topic? 0
  • +

Replies To: how to make newlines in textfile

#2 modi123_1  Icon User is offline

  • Suiter #2
  • member icon


Reputation: 3561
  • View blog
  • Posts: 14,989
  • Joined: 12-June 08

Re: how to make newlines in textfile

Posted 05 February 2012 - 01:38 PM

I tend to write
Environment.NewLine


to the file.. that works nicely.
Was This Post Helpful? 1
  • +
  • -

#3 nK0de  Icon User is offline

  • can't spell BITCH without IT
  • member icon

Reputation: 183
  • View blog
  • Posts: 732
  • Joined: 21-December 11

Re: how to make newlines in textfile

Posted 05 February 2012 - 01:58 PM

Your question is a bit confusing. The title says newlines but in the question, it says spaces. And what does a database has to do with writing to text files?

anyways, to make spaces in between, you can add & vbTab to the end of the string.
And for newlines, its & vbCrLf (it pretty much resembles Environment.NewLine as modi123_1 has mentioned)
Was This Post Helpful? 0
  • +
  • -

#4 demausdauth  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 162
  • View blog
  • Posts: 563
  • Joined: 03-February 10

Re: how to make newlines in textfile

Posted 05 February 2012 - 05:35 PM

As a note: Environment.Newline should be the way you should go. The reason being that this will use the newline character of the client computer. As programmers we all know that not every computer uses the same character(s) to represent a new line. Where as the vbCrLf will always put in a carriage return \r (which moves the cursor to the beginning of the current line), and a line feed \n(which only moves the line up one does not reset the to the beginning of the next line).

This post has been edited by demausdauth: 05 February 2012 - 06:20 PM

Was This Post Helpful? 2
  • +
  • -

Page 1 of 1