Solved

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

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

Technology Partners: 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

756 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