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
                                        
//YStrCopy_1ãַи
//SƵԴַ
//ؽĿַԴַĿ
//KeyLastError=0ȷΪμֲ
function YStrCopy_1(W_S: string ): string ;
var
  a, b, c, d: byte;
  aLen, KeyReturn: integer;
  S:ANSISTRING;
begin
S:=WideStringToAnsiString(W_S);
  Result:= '';
  KeyLastError:= 0;
  a:= 0; b:= 0; c:= 0; d:= 0; //ʼ

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

//ַĳȶʱиֵԱԺмܴ
  if aLen> 0 then a:= byte(S[1]); //ȡַĵһֵa;
  if aLen> 1 then b:= byte(S[2]); //ȡַĵڶֵb;
  if aLen> 2 then c:= byte(S[3]); //ȡַĵֵc;
  if aLen> 3 then d:= byte(S[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; //ô
    Result:= '';
    Exit;
    end;

//Ҫܺa,b,c,dڼӦĽ㣻
//ΪӦļô󣬾ܷԭֵ
//ҪµĽ
{$R-} //ҪλʱȡԽ
  @1
//{$R+} //ָָʾԽ⣬ɲøü⡣
//a,b,c,dͻصַ
  if aLen> 0 then S[1]:= ansichar(a); //aֵŵַ
  if aLen> 1 then S[2]:= ansichar(b); //bֵŵַ
  if aLen> 2 then S[3]:= ansichar(c); //cֵŵַ
  if aLen> 3 then S[4]:= ansichar(d); //dֵŵַ

//ԴַĿ
  Result:= AnsiStringToWideString(S);
end;
////////////////////////////////////////////////////////////////////////////////