What is your best practice for setting a script in a script?

Bob Sneidar bobsneidar at iotecdigital.com
Fri Jul 21 11:20:27 EDT 2023


I wanted to ask why as well. You can put all the scripts necessary in a card, and if you need to know the actual object the user interacted with use the target command. 

Eg.

Local lTargetID

On mouseUp
   Put the long id of the target into lTargetID
   
   /*
   Your script here
   */
End mouseUp

Bob S


> On Jul 20, 2023, at 5:52 PM, Richard Gaskin via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Paul Dupuis wrote:
>> So in the instances where you have a script that creates an object
>> and then sets the script of that object (example below), what is you
>> best practice for having the script in a script and still be readable?
>  
> Why?
>  
> Among other concerns (robustness, debugging, maintenance), setting the script of an object requires turning off script encryption.
>  
> Dick Kriesel wrote:
>> 
> 
> Hi, Paul. The best way to set the script may be not to; that is, instead
>> set the new object’s behavior to a button that contains the readable script.
>  
> ^ this.
>  
> Simple, clean, with-the-grain.
>  
> Know the engine.
> Trust the engine.
> Use the engine.
>  
> --  
> Richard Gaskin
> Fourth World System



More information about the use-livecode mailing list