Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2001-06-03
3
Medium Priority
?
608 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 1200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

810 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