problem with transfert of data from one substack to another one
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Wed Nov 22 13:11:50 EST 2006
Bonjour André,
When you write "put theItem into gTheTarget", the engine understands
that you want to put the parameter theItem into the global variable
gTheTarget.
If you add at the end of your menuPick handler "put gTheTarget" you
will check this.
But...
if you write do "put theItem into" && gTheTarget, the engine will
substitute the value of gTheTarget and put the value in the field.
And I assume it's what you want :-)
Check the do command in the docs: it's an invaluable command even if
you have to know that using do can slow down code execution.
But in this case it will be always unnoticeable.
Best Regards from Paris,
Eric Chatonet
Le 22 nov. 06 à 18:23, André.Bisseret a écrit :
> Hi,
>
> On a card, in a substack I have a field « duration » to be filled
> in with possible lenghts of time.
> On the card of another substack named « theTools » I have a pop Up
> button (say « PossibleDurations ») with a list of menu items such
> as « one day »,… « three days »,…, « one week », …, « three weeks »,
> …, « one month », …, « three months »,…
>
> In the first substack, the script of the field « duration » is :
>
> on mouseUp
> global gTheTarget,
> -------------------
> put the long name of me into gTheTarget
> open stack "theTools"
> end mouseUp
>
> In the substack « theTools », the script of the button «
> possibleDurations » is :
>
> on menuPick theItem
> global gtheTarget,
> ----------------
> put theItem – in msg
> put cr & gLaCible after msg
> put theItem into gTheTarget
> end menuPick
>
> In the message box, theItem and gLaCible are right
>
> But the line « put theItem into gTheTarget » does works ; nothing
> happens, no error message.
>
> Now I have spent a couple of hours trying to find why, I am
> completely lost :-((
>
> Could somebody tell me what I am doing wrong ?
>
> Thanks a lot for any help
>
> Best regards from Grenoble
> André
------------------------------------------------------------------------
----------------------
http://www.sosmartsoftware.com/ eric.chatonet at sosmartsoftware.com/
More information about the use-livecode
mailing list