B
batconv
Unregistered / Unconfirmed
GUEST, unregistred user!
函数GetHzPy是提取汉字拼音首字母的(论坛上的帖子),在D2007下运行正常,今天装上D2009尝尝鲜,却发现执行到“#162:”这一行时出错,无法继续执行,提示信息:[DCC Error]PY.pas(1371): E2030 Duplicate case label 。请高手帮忙看看解释一下,谢谢。function GetHzPy(HzChar: PChar; Len: Integer): String; var C: Char; Index: Integer; begin Result := ''; if (Len > 1) and (HzChar[0] >= #129) and (HzChar[1] >= #64) then begin case HzChar[0] of #163: begin C := Chr(Ord(HzChar[1]) - 128); if C in ['a'..'z', 'A'..'Z', '0'..'9', '(', ')', '[', ']'] then Result := C else Result := ''; end; #162: begin if HzChar[1] > #160 then Result := CharIndex[Ord(HzChar[1]) - 160] else Result := ''; end; #166: begin if HzChar[1] in [#$A1..#$B8] then Result := CharIndex2[Ord(HzChar[1]) - $A0] else if HzChar[1] in [#$C1..#$D8] then Result := CharIndex2[Ord(HzChar[1]) - $C0] else Result := ''; end; else begin Index := PyCodeIndex[Ord(HzChar[0]) - 128, Ord(HzChar[1]) - 63]; if Index = 0 then Result := '' else Result := PyMusicCode[Index]; end; end; end else if Len > 0 then begin if HzChar[0] in ['a'..'z', 'A'..'Z', '0'..'9', '(', ')', '[', ']', '.', '!', '@', '#', '$', '%', '^', '&', '*', '-', '+', '<', '>', '?', ':', '"'] then Result := HzChar[0] else Result := ''; end; end;