Solved

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

Posted on 2001-06-03
3
585 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
[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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

717 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