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;
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
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.