Greetings!
I put initialized string variable as result or as out param to some function, that returns me HEX-string. But after some magic, out variable doesn't exists anymore.
See code and comments.
This problem makes me a bit crazy today.

procedure MAINROUTIME()
const
INT_ONE = 1; //even or INT_ONE:Integer = 1; gives me the same result
var
s1:string;
begin
s1 := ''; //Init s1
GetTigerHash(IntToStr(INT_ONE),s1); //Step 1. Send '1'
end;
function GetTigerHash(sData: string; out Str: string): boolean; overload;
var
hash: TDCP_tiger;
TigerBuff: array[0..2] of byte;
begin
Result := False;
Str := ''; //Step 2,reinit out param, all is ok. Str are accessible
hash := TDCP_tiger.Create(nil);
try
hash.Init;
hash.UpdateStr(sData);
hash.Final(TigerBuff); //Here I have array result bytes {29,87,49}
Str := BinToStr(TigerBuff); //Step 3 into BinToStr, see it below
// STEP 5 - Str isn't accessible anymore. I'm going away.... with access violation
Result := True;
finally
FreeAndNil(hash);
end;
end;
function BinToStr(const bin: array of byte): string;
var
i: integer;
s: string;
begin
Result := '';
s := '';
for i := low(bin) to high(bin) do
s := s + IntToHex(bin[i], 2);
Result := s; //Step 4, Here, I see the s variable contains string "1D5731"
end;
Why that happens!? This also happens when I use a function result instead of out param.
Why after hash.final() out str param is not accessible anymore?
It makes me crazy...
I use official Lazarus releasefrom web-site, is a 1.2.6 Lazarus.