Recent

Author Topic: Error: Type TRADIOBUTTON has no component named CHECKED.  (Read 817 times)

Username

  • New Member
  • *
  • Posts: 30
Error: Type TRADIOBUTTON has no component named CHECKED.
« on: November 26, 2022, 03:46:51 am »
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
« Last Edit: November 26, 2022, 05:23:57 am by Username »

Username

  • New Member
  • *
  • Posts: 30
Re: Error: Type TRADIOBUTTON has no component named CHECKED.
« Reply #1 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. 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

  • Hero Member
  • *****
  • Posts: 4144
Re: Error: Type TRADIOBUTTON has no component named CHECKED.
« Reply #2 on: November 26, 2022, 10:07:07 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.
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.  %)
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

  • New Member
  • *
  • Posts: 30
Re: Error: Type TRADIOBUTTON has no component named CHECKED.
« Reply #3 on: November 26, 2022, 10:18:27 am »
Thanks HowardPC. I get it now. I appreciate the explanation.

 

TinyPortal © 2005-2018