Solved

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

Posted on 2001-06-03
3
559 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
Comment Utility
Take a look at OemToChar and CharToOEM WinAPI functions...
0
 

Accepted Solution

by:
Joras earned 300 total points
Comment Utility
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
Comment Utility
...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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

12 Experts available now in Live!

Get 1:1 Help Now