Acessing button scripts in a HC stack ?

J. Landman Gay jacque at hyperactivesw.com
Tue Mar 21 19:08:33 EST 2006


Francis Nugent Dixon wrote:
> Hi from Paris,
> 
> I thought that I had been explicit, but apparently not !
> 
>  From a Rev 2.6.1 stack, I want to open a HC stack (at the
> same time), examine it visually, type a name into a field in
> the Rev stack which corresponds to a button that I see in
> the HC stack. Then I want to hit a button in the Rev stack
> which picks up the script from that button in the HC stack,
> and returns it to the Rev stack where I can play with it, using
> a Rev script.
> 
> I also want to do the same with scripts from fields.

All newly imported HC stacks have their HCAddressing property set to 
true. That means you must reference the button, or any other object, 
just as HC does. If you say "button 1" then Rev will assume the button 
is a card button. If you want to specify a background button you must 
reference it as "bg btn 1". Same for fields: "fld 1" means a background 
field, and if you want to refer to a card field, you must specify "cd 
fld 1".

If you set the HCAddressing of the stack to false, after that you can 
refer to the objects in the Revolution way, without specifying "card" or 
"background".

Another thing that may be happening is that when you click on the Rev 
stack, your scripts will try to find "button 1" in the Rev stack. 
Instead, you must specify the stack:

   get the script of bg btn 1 of this cd of stack "myImportStack"

Another way to do the same thing is to set the defaultstack:

   set the defaultstack to "myImportStack"
   get the script of bg btn 1 of this cd

> 
> Please don't ask me why I don't use "Cut" and "Paste" .....

I won't, though it would probably be easier. But I do wonder why you 
don't just use the imported stack. Why move everything? I have converted 
more HC stacks than probably anyone (it's a lot of what my company does) 
and I have never had to rebuild a HC stack from scratch.

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



More information about the use-livecode mailing list