Call vs Send
Dennis Brown
see3d at writeme.com
Wed Jun 8 15:54:55 EDT 2005
I have two versions of a script. The first uses an implicit send and
works. The second uses a call and does not work. I was trying to
simplify and expand my scripting abilities with call, but I must be
missing something, because I can't see what is wrong with it. I
appreciate any insights.
Dennis
Working script of field "PN1":
on mouseUp
SaveMeTxt (token 1 to 5 of the long name of me)"e --this form
is used because the name is reused in different groups
end mouseUp
Script in the card:
global SetName,PN1
on SaveMeTxt myName --save the fld text
do "set the data"&SetName&" of "&myName&" to "&myName --save fld
contents
do "put "&myName&" into "&the short name of myName --fill shadow
global
end SaveMeTxt
-------------------------------------------
Nonworking script in field "PN1":
on mouseUp
call SaveMeTxt
end mouseUp
Script in the card:
global SetName,PN1
on SaveMeTxt --save the fld text
do "set the data"&SetName&" of me to me" --save fld contents
do "put me into "&the short name of me --fill shadow global
end SaveMeTxt
Error message:
executing at 3:20:59 PM
Type Chunk: destination is not a container
Object card id 1002
Line do "set the data"&SetName&" of me to me" --save fld contents
Hint put me into card id 1002
More information about the use-livecode
mailing list