custom properties

J. Landman Gay jacque at hyperactivesw.com
Fri May 6 01:01:24 EDT 2005


On 5/5/05 9:05 AM, Paul Salyers wrote:

> Dear Rev programmers,
> 
> Can some 1 make a simple stack that will defind a variable
> 
> and place it on a custom properties so other Rev programs can use this 
> custom properties.
> 
> I did a search and found nothing that I could understand.

I'm not sure I understand what you need. Do you want to be able to 
access a custom property from another stack? That's pretty easy. Or do 
you mean you want different standalones to access each other's 
properties? That's not easily done.

If you just mean you want to share a custom property between stacks, all 
you need to do is refer to it. Here's how:

To set a custom property, you just use it the same way you do with a 
variable. First I'll make a variable and put a value in it:

   put 10 into myVar

Now use that variable as a source for your custom property. Any object 
can have a custom property. Here is how to set one for a stack:

   set the myNumber of this stack to myVar

This creates a custom property called "myNumber" and its value will be 
the same as myVar, which is 10. Note that you must use "the" before your 
custom property name when you refer to it. Let's say the stack with the 
custom property is named "propStack". To access the property from 
another stack, you would use:

   put the myNumber of stack "propStack" into myNewVar

The variable "myNewVar" now contains 10. Let's say you assigned a custom 
property to a button instead:

   set the myNumber of btn "Do it" to myVar

If you want to retrieve that value from another stack, you need to give 
more specific information about where the custom property is located:

   put the myNumber of btn "Do it" of card "theDoItCard" of stack 
"propStack" into myNewVar

Note that these examples assume both stacks are already open. If they 
aren't, you need to specify the stack by its filename so Rev can find it.

There is a whole section in the docs under Topics -> Values and 
Properties -> Custom properties and custom property sets

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list