Exp=f
//@p1=a:= aSoft_enc_1.a;
@c1=KeyReturn:= CalculateEx_3('@f.lll', @p, 16, a, b, c, d, KeyPath, 2000);
//@p2=a:= aSoft_enc_1.a;
@c2=KeyReturn:= CalculateEx_3('@f.lll', @p, 16, a, b, c, d, KeyPath, 2000);
@va=a
@vb=b
@vc=c
@vd=d
@end
                                        
//YAnsiCompareStrãַбȽ(ִСд)
//S1ҪȽϵַ֮һ
//S2ҪȽϵַ֮һ
//ؽΪ0ַȣΪS1>S2,Ϊ,S1<S2
//KeyLastError=0ȷΪμֲ
function YAnsiCompareStr_1(S1, S2: string): integer;
var
  a, b, c, d: byte;
  aLen, KeyReturn: integer;
begin
  Result:= 0;
  KeyLastError:= 0;
  a:= 0; b:= 0; c:= 0; d:= 0; //ʼ

//ȽַS1м
  if S1= '' then
    begin
    KeyLastError:= -46;  //-46ʾЧ
    Exit;
    end;
  aLen:= Length(S1); //ȡַS1ĳ

//ַĳȶʱиֵԱԺмܴ
  if aLen> 0 then a:= byte(S1[1]); //ȡַĵһֵa;
  if aLen> 1 then b:= byte(S1[2]); //ȡַĵڶֵb;
  if aLen> 2 then c:= byte(S1[3]); //ȡַĵֵc;
  if aLen> 3 then d:= byte(S1[4]); //ȡַĵĸֵd;

//ⲽa,b,c,d͵ڲм,
//@fļе@pλôмʽ
  KeyReturn:= CalculateEx_3('@f.lll', @p, 16, a, b, c, d, KeyPath, 2000);
  if KeyReturn<> 0 then
    begin
    KeyLastError:= KeyReturn; //ô
    Exit;
    end;

//Ҫܺa,b,c,dڼӦĽ㣻
//ΪӦļô󣬾ܷԭֵ
//ҪµĽ
{$R-} //ҪλʱȡԽ
  @1
//{$R+} //ָָʾԽ⣬ɲøü⡣

//ԭa,b,c,dͻصַ
  if aLen> 0 then S1[1]:= Chr(a); //aֵŵַ
  if aLen> 1 then S1[2]:= Chr(b); //bֵŵַ
  if aLen> 2 then S1[3]:= Chr(c); //cֵŵַ
  if aLen> 3 then S1[4]:= Chr(d); //dֵŵַ

//ȽַǷ
  Result:= AnsiCompareStr(S1, S2);
end;
////////////////////////////////////////////////////////////////////////////////