with the code below:
Procedure TMyForm.doAction;
begin
generateToken;
VAR LToken := generatedToken; // Ltoken is set correctly to xxxxx
//-----
TThread.CreateAnonymousThread(
procedure
begin
GetData(LToken); // << here LToken is empty !!
end).Start;
end;
As you can see, the value of LToken is empty inside the anonymous procedure (so the capture didn't work). if I don't use inline var for LToken then it's work
Procedure TMyForm.doAction;
Var LToken: ansiString;
begin
....
end;
Is this a bug or a know limitation ?