Updating Text-Script Only Stacks in Run-Time, Message Path Memory

Sannyasin Brahmanathaswami brahma at hindu.org
Sat Nov 5 11:04:15 EDT 2016

I ran into this today: Run a boot stack that has a list of stack files,
Initialization script loads N number of stacks as libs with "start using stack x" on a loop

So far so good. I can run cmds from the message box to fire handlers in any of the stacks that were loaded with "start using"

Run into small bug… need to do some testing. All the stacks in use appear in the project browser

Open script of stack "model_preferences"  in the script editor,  Add a new handler

command checkPrefsFilePath
  answer "Hello" with "Gotcha"
# my default test just to see if the handler is in the message path before actually "coding it out"
end checkPrefsFilePath

--click yellow button… save … LC IDE flashes the "saving stack… " modal…
--go to message box; enter "checkPrefsFilePath"
--msg box returns

"checkPrefsFilePath"  and does not fire my handler… I set a break point on another handler that was in the script before startup of this session

go to msg box; enter "setPref"
and it breaks on my break point: ergo the engine sees it/found it.

But the engine does not yet "see" my new handler.  Just for fun: open stack file on disk.. in BBEdit: yes, confirmed, my changes are there.

ERGO conclude: editing a script only stack and saving it does *not* update the "live" version of that file in memory that is in use by the engine.

I guess this "kinda" makes sense, since the message path was already "assembled' at start up and editing and save script only stacks doesn’t' necessary make any change to that message path.

But, am I the only on that thinks this is odd behavior? If I am right, doesn't it break the "write, run with no compile" principle of LiveCode?  If I edit the script of a binary stack, those changes are immediately implemented. Should it not be the same for script only stacks?

OK, so given the current behavior, assuming I'm not missing something simple, do we have to manually re-issue a "start using stack "preferences.livecodescript" every time we edit it's script?

What am I missing.


More information about the Use-livecode mailing list