30.09.2010, 13:47
|
|
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Код:
function DosToWin(s: string): string;
var
i, vol: integer;
begin
for i:=1 to Length(s) do
begin
vol:=Ord(s[i]);
if vol=$f0 then
begin
s[i]:=Chr($a8);
continue;
end;
if vol=$f1 then
begin
s[i]:=Chr($b8);
continue;
end;
if (vol>=128) and (vol<=175) then
begin
s[i]:=Chr(vol+64);
end
else if (vol>=224) and (vol<=239) then
begin
s[i]:=Chr(vol+16);
end;
end;
result:=s;
end;
function WinToDos(s: string): string;
var
i, vol: integer;
begin
for i:=1 to Length(s) do
begin
vol:=Ord(s[i]);
if vol=$a8 then
begin
s[i]:=Chr($f0);
continue;
end;
if vol=$b8 then
begin
s[i]:=Chr($f1);
continue;
end;
if (vol>=192) and (vol<=239) then
begin
s[i]:=Chr(vol-64);
end;
if (vol>=240) and (vol<=239+16) then
begin
s[i]:=Chr(vol-16);
end;
end;
result:=s;
end;
__________________
Пишу программы за еду.
__________________
|