Avatar of GrahamDLovell
GrahamDLovell
 asked on

Firemonkey debugger problem for string value

I cannot see the result of a string assignment in the debugger:
procedure TfMMain.AudioPlay(WordStr: string);
var
  AudioFile: string;
begin
  AudioFile := fMMain.cdsWords.FieldByName('AudioName').AsString;
  if AudioFile = '' then
  begin
    MessageDlg('Audio not available for this word',TMsgDlgType.mtInformation,
      [TMsgDlgBtn.mbOK],0);
    exit;
  end;
end;

Open in new window

The debugger tells me the correct values for fMMain.cdsWords.FieldByName('AudioName').AsString;
but displays garbage value for the local value "AudioFile".

Is this a known problem / feature, or am I doing something wrong?

The debugger works OK if I attach the value directly to the form.
Delphi

Avatar of undefined
Last Comment
GrahamDLovell

8/22/2022 - Mon
Sinisa Vuk

which version of Delphi you use? Make sure than you disable optimization in Options.
GrahamDLovell

ASKER
XE6.

I disabled optimization in Compile options, and Built the project.

When running, instead of seeing garbage, I now get "Inaccessible value". This may not be due to turning off optimization, since I think I got that once before.
ASKER CERTIFIED SOLUTION
Sinisa Vuk

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
GrahamDLovell

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
GrahamDLovell

ASKER
Thanks for the expert advice on Firemonkey IDE.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck