Forum > Debugger

Error: Type TRADIOBUTTON has no component named CHECKED.

(1/1)

Username:
Mods: If this post should be in a different Forum, please let me know, or just move it. Not sure this is specifically a debugger topic. Maybe LCL or General?

I'm using Dwarf2 (-gw2) Debugger, I have a Watch set for a RadioButton, and in my code, this code snippet works as expected:

  If RbtnDegC.Checked then
    begin
      TempUnit.Value:=DEGC_VALUE;
      TempUnit.Text:=DEGC_VALUE_TEXT;

However, I have a Watch Window and an Evaluation Window open and both say RadioButtons don't have a "Checked" component.  Same for STATE component. I'm using Dwarf2 debugger. I've attached a screen shot of the debugger windows.

What am I doing wrong? TIA

Username:
OK, I found I can use RBtnDegC.FSTATE in the Watch window, which shows CBCHECKED as Value. But in code, I have to call it RBtn.STATE, not FSTATE. And, I still can't find any mention of the word "CHECKED" whether appended or not, in the RadioButton list of components. Clear as mud to me.  %)

howardpc:

--- Quote from: Username on November 26, 2022, 04:21:54 am ---OK, I found I can use RBtnDegC.FSTATE in the Watch window, which shows CBCHECKED as Value. But in code, I have to call it RBtn.STATE, not FSTATE.
--- End quote ---
In your code you are in a different unit from StdCtrls where FState is declared private, so you have no access to FState from your code. You can access the value only via the property State, or use the debugger which can sneak the value of FState, normally unavailable to the programmer.



--- Quote ---And, I still can't find any mention of the word "CHECKED" whether appended or not, in the RadioButton list of components. Clear as mud to me.  %)
--- End quote ---
Checked is a published property (not a component) of TRadioButton. It is listed in the Object Inspector along with all the component's other published properties. Unfortunately its value is obtainer by a getter method, so the debugger cannot (currently) show you its value.

Username:
Thanks HowardPC. I get it now. I appreciate the explanation.

Navigation

[0] Message Index

Go to full version