Firemonkey debugger problem for string value

GrahamDLovell
GrahamDLovell used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sinisa VukSoftware architect
Top Expert 2012

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

Author

Commented:
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.
Software architect
Top Expert 2012
Commented:
do you see something in debug window/local variables?
try to apply andy's IDE Fix Pack 5.92
this one patch some nasty problems - maybe this one too as a result....
Yes, I have also lost my local variables in the debug window.

I don't think I will apply the patch - I will just use my workaround (of adding the variable into the form), where required.

Thanks for the info.

Author

Commented:
Thanks for the expert advice on Firemonkey IDE.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial