dynamic scripts at runtime

Raymond Griffith rgriffit at ctc.net
Fri Jun 18 18:31:12 EDT 2004


On Friday, June 18, 2004, at 02:37  PM, RGould8 at aol.com wrote:

> I've got an app that needs to be able to generate fields dynamically 
> when
> compiled as a standalone application.   I also need to be able to 
> assign scripts
> to those newly created fields.

You will need to be aware that a standalone cannot modify itself. You 
may need to create a splash screen standalone as the "main" program, 
and the parts of the program that need to be able to be modified as a 
separate stack.

>
> The emails I've read make it sound like this is not possible, if the 
> script
> exceeds 10 commands (which mine does.)   What's the work-around?   My 
> script is
> stored in a text field on the card, and I was doing a
>
> set the script of field newFieldID to field "masterscript"
>
> I did read a posting about preparing a "library control" in the RunREV 
> IDE
> and cloning it during runtime, but I don't understand what that means. 
>   If
> someone has a script that performs such a feat, I'd love to see it.

I'd suggest setting up a templateField, but you would still need to 
"set" the script, and a ten-line limit would be a problem for that. 
Still, if you can keep it under ten lines,

set the script of the templateField to myscript

would effectively make any new fields come with that script included.

If the ten-line limit is not attractive, there are some other options.

You could set up a field with all the scripts you want included in it. 
Store it somewhere, like a stack group. Then when you want to create a 
new field with these characteristics, show the group, copy the field, 
hide the group, and paste the new field.

Where there's a Rev there's a way. (I just have to find a way to fund 
my upgrade).

Raymond


>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list