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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ascii chars

Status
Not open for further replies.

Silvano

Programmer
Jul 16, 2001
386
US
hi all,

I am using the following to write a text file:

...Settings#Chr(13)##Chr(10)##Chr(10)#UserName=admin...

the #Chr(13)##Chr(10)# gives me carriage return and line feed;
the text file looks like this:

.
.
.
Settings

UserName=admin
.
.
.

now, if the text file is opened in a note pad, edited, saved, and then reopened, the text file will look like this:

.
.
.
SettingseditedpartUserName=admin
.
.
.


basically, all line feeds and carriage returns are stripped out.

any advice as how to prevent this?
Sylvano
dsylvano@hotmail.com
 
Hey Sylvano,

I think Notepad is getting confused about the extra chr(10) and possibly removing the entire sequence. On windoze, a crlf is designation by #chr(13)##chr(10)# so if you want two crlf sequences, use #chr(13)##chr(10)##chr(13)##chr(10)# instead of #chr(13)##chr(10)##chr(10)#.

I suspect Notepad considers the 13,10,10 to be an illegal syntax and just removes it all together when saving.

Hope this helps,
GJ
 
you r right about windoze being confused heh, heh...

i have removed the carriage return and it works fine now

thx Sylvano
dsylvano@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top