calling a commad in card and stack with the same name

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
gwbasic
Posts: 34
Joined: Tue Mar 16, 2010 6:39 am

calling a commad in card and stack with the same name

Post by gwbasic » Tue Aug 24, 2010 6:00 am

I created two command with the same name. The first one is located in the stack script and the other one is located in the card script.

In the button script:

on mouseUp
test
end mouseUp

The card script gets executed. How do I call the command named test which is located in the stack script?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: calling a commad in card and stack with the same name

Post by jmburnod » Tue Aug 24, 2010 8:14 am

Hi gwbasic

You can use the pass command

Code: Select all

on mouseUp --button script
   test
end mouseUp

on test --card script
   put "myTestCard" && the ticks
   wait 500 milliseconds
   pass test
end test

on test --stack script
   put "myTestStack" && the ticks
end test
Best

Jean-Marc
https://alternatic.ch

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: calling a commad in card and stack with the same name

Post by jmburnod » Tue Aug 24, 2010 8:56 am

You can also download the stack "messages hierarchy" of Richard Gaskin here

http://support.runrev.com/scriptingconf ... rarchy.zip

It explane difference between call, send etc...

Jean-Marc
https://alternatic.ch

gwbasic
Posts: 34
Joined: Tue Mar 16, 2010 6:39 am

Re: calling a commad in card and stack with the same name

Post by gwbasic » Tue Aug 24, 2010 9:45 am

Another question. How do I call a function/command in a card/stack, located in another stack?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: calling a commad in card and stack with the same name

Post by jmburnod » Tue Aug 24, 2010 10:32 am

Look at "insert script" on the dictionary and on the stack "message hierarchy"
https://alternatic.ch

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: calling a commad in card and stack with the same name

Post by Klaus » Tue Aug 24, 2010 11:00 am

gwbasic wrote:Another question. How do I call a function/command in a card/stack, located in another stack?
For handlers use "call" :D
For functions check the Rev dictionary about "value" and see the user contributed notes at the bottom of that page.


Best

Klaus

Post Reply