?
Solved

project's question...

Posted on 1998-02-17
6
Medium Priority
?
132 Views
Last Modified: 2010-04-04
how to save a file  like .txt and
then let the user save as another format from the
  save file dialog such as .rtf, (all files)..etc?
  thus if i first save as .txt extension like jack.txt
 and then i save the same file as jack.rtf..the
  content of the 2 files will be the same and
  now i have jack.txt and jack.rtf... i am doing this feature
for my project..it looks like a bug to me..i can't save
a file .txt again as .rtf...:(
0
Comment
Question by:cooldude77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 5

Expert Comment

by:inter
ID: 1359441
Again,

Do you want this:

1 - You have a text in TRichEdit.
2 - When user selects .txt from savedialog you want to save it as text and put extention '.txt' to the end of filename.
3 - When user selects .rtf from savedialog you want to save it as REAL, ACTUAL rich text format and put extention '.rtf' to the end of filename.

Make clear these out please,
I am sure the problem is simple but we can not apprehend
Igor
0
 

Author Comment

by:cooldude77
ID: 1359442
yeah..u got my point..
if the user has a text file , he can also save it
as rich edit format..but the filename renames the same..
like jack.txt, jack.rtf
0
 
LVL 5

Accepted Solution

by:
inter earned 100 total points
ID: 1359443
Ok,

If you use Delphi 2.0+

1 - Put TRichEdit instead of TMemo in your MdiClient windows. OK?
2 - When the file extention is '.txt' (I am sure you now this now) save it as following (assume Trichedit instance is Editor)

...
  Editor.PlainText := True;
  Editor.SaveToFile('test.txt');
...
3 - When the file extention is '.rtf'  save it as following (assume Trichedit instance is Editor)

...
  Editor.PlainText := False;
  Editor.SaveToFile('test.rtf');
...

Bye!
Igor
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:cooldude77
ID: 1359444
i am using white memo now..
i cannot use richtext..it's part of the project requirement..

0
 
LVL 5

Expert Comment

by:inter
ID: 1359445
That bad news friend?

I wonder, who require you to do such a thing with TMemo? However it can be done for VERY plain text files manually. I once do it, but not that easy. Do you know file operations (opening streams, writing in them, formatting text?)? If not, I am sorry you'd better force the guy gives the project to use rich edit.

Comment Please
Igor
0
 

Author Comment

by:cooldude77
ID: 1359446
there is no way to do it?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question