PRB: OptionButtons Do Not Hold Logical Values (245062)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q245062

SYMPTOMS

In Visual FoxPro 5, it was possible to set OptionButtons to have logical values instead of numeric. However, in Visual FoxPro 6, this behavior changed. While the buttons can be set to logical values, clicking on a button will cause the button's value property to be reset to numeric.

CAUSE

OptionButtons should only have numeric values, even if the interface allows them to be set differently.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Run the following code in Visual FoxPro 6.0:
    PUBLIC loForm
    
    loForm = CREATEOBJECT("form")
    WITH loForm
       .AddObject('opgTest', 'optiongroup')
       WITH .opgTest
          .ButtonCount = 3
    
          .Option1.Value = .T.
          .Option2.Value = .F.
          .Option3.Value = .F.
    
          .Visible = .T.
          .AutoSize = .T.
       ENDwith
       .Visible = .T.
    ENDwith
    					
  2. Open the debugger, and put the following values in the Watch window:
    loForm.opgTest.option1.value
    loForm.opgTest.option2.value
    loForm.opgTest.option3.value
  3. Click the buttons and watch the debugger.
    • When first run:
      .T.
      .F.
      .F.
    • Click Option2:
      0
      1
      .F.
    • Click Option3:
      0
      0
      1
      							

Modification Type:MajorLast Reviewed:4/25/2000
Keywords:kbCodeSnippet kbCtrl kbDesigner kbDSupport kbprb KB245062 kbAudDeveloper