VALUE

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC

Description

The VALUE? command obtains the set-state of CHECKBOXes and RADIOBUTTONs. The set-state will be either "set" or "reset".

Syntax

  1. #handle.ext "value? varName$"

Hints

Check-boxes and radio-buttons can be either set or reset (cleared). To have your program query the control for its state, issue the command
#handle.ext "value? varName$"
The variable varName$ will contain the value "set" or "reset". varName$ can be most any name you choose, but must be a string variable.

Example

nomainwin

statictext #1.st1 "Click checkbox to set it or clear it:", 10, 20, 200, 25
checkbox #1.ck1 "Check me", [set], [reset], 50, 50, 100, 25

    open "Demo" for window as #1
    #1 "trapclose [quit]"

[begin]
    wait

[set]
    #1.ck1 "value? var$"                'query the state of the checkbox
    notice "The checkbox is "; var$     'display the result
    wait

[reset]
    #1.ck1 "value? var$"
    notice "The checkbox is "; var$
    wait

[quit]
    close #1
    end

Useful Procedures

' Place a useful function or sub using this keyword here