I appreciate your issue was with the "duplication" of the code, but is there also not a performance issue with the second function call?<br><br> Result := CheckNumber(GetUnicodeCategory(S, Index))<br><div id=":gq">
<br>should it not be<br><br> Result := CheckNumber(InternalGetUnicodeCategory(UCS4Char(C)))<br><br>?<br></div><br><br><div class="gmail_quote">On Sun, Jun 3, 2012 at 9:45 AM, Todd <span dir="ltr"><<a href="mailto:todd.martin.nz@gmail.com" target="_blank">todd.martin.nz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is this a representative example of the code quality Embarcadero is<br>
producing today?<br>
<br>
class function TCharacter.IsNumber(C: Char): Boolean;<br>
begin<br>
if not IsLatin1(C) then<br>
Result := CheckNumber(InternalGetUnicodeCategory(UCS4Char(C)))<br>
else if not IsAscii(C) then<br>
Result := CheckNumber(InternalGetLatin1Category(C))<br>
else<br>
Result := (C >= '0') and (C <= '9');<br>
end;<br>
<br>
class function TCharacter.IsNumber(const S: string; Index: Integer):<br>
Boolean;<br>
var<br>
C: Char;<br>
begin<br>
CheckStringRange(S, Index);<br>
C := S[Index];<br>
if not IsLatin1(C) then<br>
Result := CheckNumber(GetUnicodeCategory(S, Index))<br>
else if not IsAscii(C) then<br>
Result := CheckNumber(InternalGetLatin1Category(C))<br>
else<br>
Result := (C >= '0') and (C <= '9');<br>
end;<br>
<br>
Todd.<br>
_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Pawel Rewak<br>Acumen Data<br><br>