I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

December Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi Single User Apps Topic   Print This     

CR/LF problem

CR/LF problem in Delphi Single User Apps topic (part of our Pascal and Delphi Coding group).

Quick Search: problem   CR/LF problem  
Jeet
ATLANTA
I am a newbie to Delphi programming.

I am trying to write LF (linefeed) character in a ASCII file using Delphi application. But it always writes CRLF instead. No matter what I do it prefixes CR with LF.

Can anybody help me how to fix the problem?

Thanks in advance.
Big Grin!
 Posted 18 years ago (Thread Starter)
Comment Quote
About Jeet -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #4395, 1 replies
Thread Started 11/21/2001 10:15:00 AM
View Counter=1787
Last Reply Posted 12/6/2001 8:33:00 AM)
Location=ATLANTA  
Joined=18 years ago   MB Posts=1  
Most Recent Post
Larry J. Rutledge
Prestwood IT
Citrus Heights, CA USA
It depends on how you are writing to the file. If you use WriteLn then it will always append [CR][LF] to the end of each line. However, if you use Write, then nothing is appended and you can write out a [LF] wherever you want it to appear.

For example:

procedure Form1.WriteToFile;
var
OutFile: TEXTFILE;

begin
AssignFile(OutFile, 'temp.txt');
Rewrite(OutFile);
Write(OutFile, 'This is the first line.' + #10);
Write(OutFile, 'This is the second line.' + #10);
Write(OutFile, 'And this is the final line.' + #10);
CloseFile(OutFile);
end.


Hope this helps,
Larry
Larry J. Rutledge

Analyst

Prestwood Software

www.prestwood.com
 Posted 18 years ago
Comment Quote
About Larry J. Rutledge -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Larry J. Rutledge
I worked for Prestwood Software as a Delphi developer from 1997 through 2002. During that time I enjoyed working with Mike Prestwood and the other developers at Prestwood.

Post ID #4525 (Level 1.1)  Reply to 4395
Thread Started 12/6/2001 8:33:00 AM
View Counter=2
Location=Citrus Heights, CA USA 
Joined=19 years ago   MB Posts=73   KB Posts=9  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1103A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #4395 Counter
1787
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech