Binary String to Enable Objects
Rob Cozens
rcozens at pon.net
Sat Nov 19 10:40:28 EST 2005
Hi Alex,
>That's neat ! I would never have thought of using the IDs - I've
>never set an ID to a specific value
You can only set image ids: the ids of other controls cannot be changed.
But the key lies in "set the enabled of control ID (i + 2000) to
(item i of tBinStr = 1)" -- which I believe should actually be
"set the enabled of control ID (i + 2000) to (char i of tBinStr = 1)"
* You can create the controls one after the other so they have
consecutive ids; but what happens if you need to add one later?
* You could pass a list of the ids or name of the objects:
"set the enabled of control ID (line i of myControlList) to
(item i of tBinStr = 1)"
* You could group the 32 objects, maintain tBinStr as a custom
property or local variable, and use this handler in the group script:
get the tBinStr of me
put 0 into objectNumber
repeat for each char controlSetting in it
add 1 to objectNumber
set the enabled of control objectNumber of me to
(controlSetting = 1)
end repeat
Rob Cozens CCW
Serendipity Software Company
"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."
from "The Triple Foole" by John Donne (1572-1631)
More information about the use-livecode
mailing list