Self adjusting code?
rjb at rz.uni-potsdam.de
Wed May 5 04:44:59 CDT 2004
>My first post to this list...
>I am a SuperCard user (for 14 years). I am of course interested in
>Revolution's multi-platform output. However... in reading some of
>your tutorials, I came across a blurb outlining a restriction on
>making run-time changes to Revolution projects (stacks). I am
>interested in evolving code... projects that react to, optimize and
>adjust to their environment... who uses them and their intent, and
>available media, data and communications streams. How does one do
>this with Revolution? I can imagine a solution involving two
>concurrent projects... one running... the other treated as data
>file... adjusted by the first... then, periodically, the first
>duplicates the second (now there are three), launches the second
>which once launched, quits and deletes the first, then, gets down to
>the business of writing changes to it's inactive clone. Wow, that
>seems complex... but I can't quite imagine how else to do run-time
>self-adjusting code. How have you people solved this problem.
>randall at thinkthink.com
What you envision is possible but you really need to plan things well
ahead. There are two basic restrictions that come in your way.
1. Standalone applications can't modify self. You can modify the code
on the fly but the changes can't be saved into the same file.
However, this is not a show stopper for you since your standalone can
contain only the persistent code and all other codes can reside in
stack files that can be modified at runtime.
2. When running as a standalone, you are not allowed to compile more
than 10 lines of code (see the scriptLimits in Rev's docs). This
applies to both replacement of handlers as well as execution through
'do'. I see this as a serious issue for you since it will likely make
the workabout from #1 useless. To work around script limits, you
would need to break your code in really small chunks, which does not
sound plausible for this task. A better solution would be to
negotiate with RunRev a special license that increases the script
limits. If you have enough funds, you can get the embedded product
that allows you to work around this. But this is quite a costly
No problems, of course, if you are developing this for your own usage
and can do all execution under licensed IDEs (I mean that the
projects execute only when running in licensed IDE's -- I am using
plural in case multiple computers are involved). Considering the
relatively low price of Rev Express, this may be an acceptable
More information about the use-livecode