⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gethzpy.pas

📁 龙矿集团工资管理系统2004源码
💻 PAS
字号:
unit GetHzPy;

interface
  function HzPy(sr:String): String;

implementation

const ChinaCode: array[0..25,0..1] of Integer = ((1601,1636), (1637,1832), (1833,2077),
      (2078,2273),(2274,2301),(2302,2432),(2433,2593),(2594,2786),(9999,0000),
      (2787,3105),(3106,3211),(3212,3471),(3472,3634),(3635,3722),(3723,3729),
      (3730,3857),(3858,4026),(4027,4085),(4086,4389),(4390,4557),(9999,0000),
      (9999,0000),(4558,4683),(4684,4924),(4925,5248),(5249,5589));

function HzPy(sr: String): String;
var
   C1, Len1, C2: Integer;
   ir : Word;
   FResult : String;
begin
FResult := '';
C1 := 1;
Len1 := Length(sr);
while (C1<=Len1) do
    begin
    if (ord(sr[C1])>=160) and (ord(sr[C1+1])>=160) then
       begin
       ir := (ord(sr[C1])-160)*100 + ord(sr[C1+1])-160;
       C2 := 1;
       while (C2<=26) do
          begin
          if (ir>=ChinaCode[C2,0]) and (ir<=ChinaCode[C2,1]) then
             begin
             FResult := FResult+chr(C2+ord('a'));
             break;
             end;
          C2 := C2 + 1;
          end;
       end;
    C1 := C1 + 2;
    end;
Result := FResult;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -