Sonjli 6 Posted September 26 Hello, I hope to be in the right place. Also, I don't find this behaviour in forum neither in embt quality. I am in debug with a breakpoint inside an anon method and when I try to evaluate a variable (CTRL + F7, mouse over, watches, etc. ) I get a "undeclared identifier" if I use a class field. Example: TmyDM = class(TDataModule) Comp: TADOQuery; ... end; ... procedure ...blabla...; var CompForDebug: TADOQuery; begin Comp.Close; Comp.Parameters.ParamByName('test').Value := 100; Comp.Open; // <-- Here evaluate "Comp". I get the right thing FmyList.ForEach( procedure(const obj: IMyThing) var CompForDebugLocal: TADOQuery; begin Comp.Close; Comp.Parameters.ParamByName('test').Value := 100; Comp.Open; // <-- Here evaluate "Comp". I get "Undeclared identifier" // This doesn't work: CompForDebugLocal := Comp; CompForDebugLocal.Close; CompForDebugLocal.Parameters.ParamByName('test').Value := 100; CompForDebugLocal.Open; // <-- Here evaluate "Comp". I get "Undeclared identifier" // This doesn't work: CompForDebug := Comp; CompForDebug.Close; CompForDebug.Parameters.ParamByName('test').Value := 100; CompForDebug.Open; // <-- Here evaluate "Comp". I get the right thing end ); end; Share this post Link to post
Cristian Peța 103 Posted September 26 Comp is captured and I can confirm debugger evaluator is not working. Declare LComp: TADOQuery in anonymous method and assign LComp := Comp. Then it will work to evaluate LComp.... Share this post Link to post
Sonjli 6 Posted September 26 9 minutes ago, Cristian Peța said: Comp is captured and I can confirm debugger evaluator is not working. Declare LComp: TADOQuery in anonymous method and assign LComp := Comp. Then it will work to evaluate LComp.... Ok, thanks. I needed a confirmation. Same exact behaviour is for inline variables inside anon method... no way to evaluate them during debug. It's frustrating if you are working with Spring4d or other modern libraries. Share this post Link to post
Sonjli 6 Posted September 26 Added embt quality https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-1922 1 Share this post Link to post