Call a function on another card

Bob Sneidar bobsneidar at iotecdigital.com
Thu Feb 23 17:03:40 EST 2017


When I encounter situations like these, I begin to ask myself why the handler is in a card script. If it needs to be accessible from other cards, it should probably be moved to the stack script, or put into a button and inserted into front or back. I have 3 buttons I use for this effect: Utilities, Validations and Database Functions. Utilities and Database functions I insert into back. The validations I insert into front in case I want to intercept things like openField or selectionChanged and do things before passing them on. 

Bob S


> On Feb 23, 2017, at 13:21 , Peter Bogdanoff via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Yes, thank you, that works. I used:
> 
> dispatch function "getPageNumber" to card "MITA" of stack "MITA" with tID
> 
> What came back was in “the result”
> 
> “it” contained “handled”
> 
> pb
> 
> On Feb 23, 2017, at 12:54 PM, Mike Bonner via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
>> Will this work for you?
>> dispatch function "myFunction" to card "myCard"
>> 
>> put the result into tResult
>> 
>> Parameters can also be passed using the "with" extension. Unlike the
>> "call", "send" and "value" handlers, the parameters are sent directly to
>> the target handler, rather than being extracted from the string used to
>> call the handler. This negates the need to surround our parameters in
>> quotes and also allows us to pass arrays
>> 
>> On Thu, Feb 23, 2017 at 1:32 PM, Peter Bogdanoff via use-livecode <
>> use-livecode at lists.runrev.com> wrote:
>> 
>>> Hi,
>>> 
>>> I’m reading on
>>> http://lessons.livecode.com/m/4071/l/11787-how-to-call-a-
>>> function-or-command-in-another-object
>>> 
>>> this:
>>> put value("myFunction(hello, world)", group "myGroup" of card "myCard")
>>> into tResult
>>> 
>>> I want to use a variable as a parameter instead of “hello, world” as in
>>> the page example.
>>> 
>>> These don’t work:
>>> put value(“getPageNumber (tID)", card "MITA" of stack "MITA") into tResult
>>> put value("getPageNumber" & (tID), card "MITA" of stack "MITA") into
>>> tResult
>>> 
>>> What do I do?
>>> 
>>> Peter Bogdanoff
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list