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

Paul Dupuis paul at researchware.com
Sat Jul 15 19:43:53 EDT 2023


That's pretty good!


On 7/15/2023 7:14 PM, Geoff Canyon via use-livecode wrote:
> Custom properties would definitely be my go-to, similar to what others have
> said. That said, I think the merge command is your friend here.
>
> This script in a button does what you want:
>
> on mouseUp
>     set the script of button "Sample" to \
>           merge("on mouseUp[[cr]]" &\
>           "ask [[quote]]Please enter a number between 1 and
> 100[[quote]][[cr]]" &\
>           "if it is not a number then exit mouseUp[[cr]]" &\
>           "if it < 1 OR it > 100 then exit mouseUp[[cr]]" &\
>           "put it into field [[quote]]Number[[quote]][[cr]]" &\
>           "end mouseUp")
> end mouseUp
>
> The use of \ to continue, and [[quote]] and [[cr]] results in a pretty
> readable script to my eye at least.



More information about the use-livecode mailing list