HTBasic Help
×
Menu
Index

Changing Widget Attribute Values

 
Three ways to change attribute values using the CONTROL command are:
 
·
You can change an attribute value with a single CONTROL statement. For example:
 
                 CONTROL @Meter;SET("VALUE":22)
 
·
You can also change multiple attribute values with multiple CONTROL statements.
        For example:
 
                 CONTROL @Bars;SET("BACKGROUND":5)
                 CONTROL @Bars;SET("SHOW LIMITS":0)
                 CONTROL @Bars;SET("VALUE":44)
 
·
You can also change multiple attribute values with a single CONTROL statement.
        For example:
 
                 CONTROL @Bars;SET("BACKGROUND":5,"SHOW LIMITS":0,"VALUE":44)
 
Example: Changing Widget Attributes
 
For example, for a METER widget you can change the value of the common attribute
BACKGROUND using the ASSIGN command as follows, where "2" sets the background
color to red:
 
  10  ASSIGN @Meter TO WIDGET "METER";SET ("BACKGROUND":2)
  20  LOOP
  30  END LOOP
  40  END
 
Or if you prefer, the BACKGROUND attribute may be SET with the CONTROL statement:
 
  10  ASSIGN @Meter TO WIDGET "METER"
  20  CONTROL @Meter;SET ("BACKGROUND":2)
  30  LOOP
  40  END LOOP
  50  END