Solved

DOS (PC-8) text file format in TRichEdit with Delphi 3

Posted on 2001-06-03
3
565 Views
Last Modified: 2008-01-09
Hi,
I want to know how can convert DOS or OS/2(PC-8) text file format with Delphi 3. For example: I want to load Cyrillic DOS .TXT file in TRichEdit and convert it.

Thanks for your help in advance!
Best Regards
0
Comment
Question by:neshkov
3 Comments
 
LVL 4

Expert Comment

by:DMN
ID: 6150932
Take a look at OemToChar and CharToOEM WinAPI functions...
0
 

Accepted Solution

by:
Joras earned 300 total points
ID: 6151705
hi neshkov.
it's a simple exaple:

procedure TForm1.Button1Click(Sender: TObject);
var
  p:PChar;
  str:string;
  f:TextFile;
begin
  if OpenDialog1.Execute then begin
    AssignFile(F,OpenDialog1.FileName);
    Reset(f);
    while not eof(f) do begin
      readln(f,str);
      GetMem(p,Length(str)+1);
      strPCopy(p,str);
      OemToChar(p,p);
      RichEdit1.Lines.Add(string(p));
      FreeMem(p,Length(str)+1);
    end;  
    CloseFile(f);
  end;
end;
0
 

Author Comment

by:neshkov
ID: 6151820
...OK, Thank you DMN and Joras, thanks for all.. it was a stupid question, I can't believe that it is so easy...shame for me...
Easy points for Joras. Thanks again DMN.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now