private command gotcha

Bob Sneidar bobsneidar at iotecdigital.com
Fri Sep 8 11:04:42 EDT 2017


Looks like others have answered your question in my stead. :-) I will give you a good use case. 

I have a series of buttons on various cards/substacks that all do almost the exact same thing: Query for data, populate the card, create delete edit data, etc. This makes them prime candidates for behaviors, especially now that I have 15 different "forms" that use them. 

I say *almost* the exact same things because certain cards, like the site card for instance need to do a little more. I save the SMTP configuration data for a particular site including the password which I encrypt in transit and in storage. I call it customFormStuff. 

So a behavior could be written to "dispatch customFormStuff to me" and if there was no handler it would silently fail while the LC engine and the rest of the world went on in blissful ignorance. Now I could write the behavior to be form specific and check the name of the card and act accordingly, but that makes the behavior non-portable/non-scalable. 

Bob S


> On Sep 7, 2017, at 14:01 , Monte Goulding via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> 
>> On 8 Sep 2017, at 3:57 am, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> Here's a surprise! You cannot dispatch to a private command or function, EVEN THOUGH the private command or function is in the SAME SCRIPT!
> 
> Nor can you send in time… however why do you want to dispatch to the same script?
> 
> Cheers
> 
> Monte
> _______________________________________________
> 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