DEADSOFTWARE

60ea1a790ec13d20c735d31c1266aed5873563b2
[d2df-editor.git] / codepage.pas
1 unit codepage;
3 interface
5 implementation
7 uses windows;
9 function ConOutFunc(var Text: TTextRec): Integer;
10 var
11 a: LongWord;
12 _pos: Integer;
13 begin
14 Result := 0;
16 _pos := Text.BufPos;
18 if _pos <= 0 then Exit;
20 Text.BufPos := 0;
21 CharToOemBuff(Text.BufPtr, Text.BufPtr, _pos);
22 if not WriteFile(Text.Handle, Text.BufPtr^, _pos, a, nil) then
23 Result := GetLastError;
24 end;
26 initialization
28 Rewrite(Output);
29 TTextRec(Output).InOutFunc := @ConOutFunc;
30 TTextRec(Output).FlushFunc := @ConOutFunc;
32 end.