Putting values into variables

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

Putting values into variables

Post by bjb007 » Thu Mar 13, 2008 9:09 am

I have a recurring problem figuring
out the syntax for getting the contents
of a field etc. into a variable.

Have tried 100 combinations of

put label comboRedBlack into arrayParms[RedBlack]

to put the value in a combo box into an array
and get a variety of error messages. It's in the
label of the combo box - and really doesn't want
to leave.

Has anyone worked out some general rules for
this (apparently) simple operation which would be
handled in other languages quite easily by reference.

My sanity is at stake here.
Life is just a bowl of cherries.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu Mar 13, 2008 9:58 am

Hi Bjb007,

A label is a property. It is preceded by "the" and followed by "of" and a reference to an object.

Code: Select all

put the label of btn "Your Combobox" into myVar
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

Putting values into variables

Post by bjb007 » Thu Mar 13, 2008 1:50 pm

Well, well, there's a real twist!

A combobox is a button?

Never would have thought of that one.

From the docs:
"Button objects can be push buttons, checkboxes,
radio buttons, or menus, depending on the setting
of their style property."

Interesting also that the array is sorted
alphabetically so if you refered to
it by element number you'd get
the wrong value.
Life is just a bowl of cherries.

Post Reply