Announcement

Collapse
No announcement yet.

convert text to number

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • convert text to number

    I would like to assign a numeric value to a variable based on the checked or uncheck status of a checkbox object. Possible?

  • #2
    Welcome to the forum,
    try -
    Code:
    --Use IF ...THEN statement to verify if a CheckBox is checked and use the "true" argument,
    
    bnumber = 0
    
    if CheckBox.GetChecked ("CheckBox1") == true then
    bnumber = 1
    end
    
    if CheckBox.GetChecked ("CheckBox2") == true then
    bnumber = 2
    end
    OR

    Code:
    if CheckBox.GetChecked ("CheckBox1") == true then
    bnumber = 1
    else
    bnumber = 0
    end

    Comment

    Working...
    X