How to add a value to an Item of a menu option button
Byron
byront at mac.com
Tue Dec 28 13:43:51 EST 2004
I'm working on a project where I capture the same kind of information .
. series of objects with names that end in numbers. As I'm pretty
inexperienced and didn't understand Jérôme's suggestion, I thought I'd
mention what I've been doing and see if perhaps I'm going about this in
the wrong way. I've been using scripts like
get the last character of (myObject)
or
repeat with x = 1 to 6
put empty into field ("object" & x)
set the label of button ("otherObject" & x) to "none"
end repeat
Is this sort of thing particularly inefficient? Am I missing something
critical if I don't delve into custom properties?
Byron
On Dec 26, 2004, at 3:10 PM, Ken Ray wrote:
> On 12/26/04 4:51 PM, "Jérôme Rosat" <jrosat at mac.com> wrote:
>
>> Bonjour à tous,
>>
>> In my database, I've got a table with two fields and many records:
>>
>> Value Name
>>
>> 12 Name1
>> 16 Name2
>> 25 Name3
>> etc.
>>
>> On a card I created a menu option button with items come from the
>> field
>> Name of my database:
>> Menu Items:
>> Name1
>> Name2
>> Name3
>> etc.
>>
>> But when I select an option, I need to now the value of the item
>> selected, not the item itself.
>> For example, if I select "Name2", I need to know the value "16".
>>
>> How to add a value to an Item of a menu option button ?
> Yes. You can add a custom property (like uMenuValue) to the option
> button
> that contains the values, one on each line:
>
> 12
> 16
> 25
>
> And then do this:
>
> on menuPick
> put line (the menuHistory of me) of the uMenuValue of me into tValue
> -- gets the corresponding line in the custom property to the line
> selected
> -- in the option menu
>
> -- do something with tValue
> end menuPick
>
> Ken Ray
> Sons of Thunder Software
> Web site: http://www.sonsothunder.com/
> Email: kray at sonsothunder.com
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list