closeControl -- "switchable" ?

Sannyasin Brahmanathaswami brahma at
Tue Jan 21 09:11:33 EST 2020

Using text only script behavior files has advantages and disadvantages. One "con" is the possibility of "rapid profileration" of text scripts (behavior, model, libraries etc.) 

 Your app could easily become like some horrendous-humongous PHP or JS framework with 100's of "dependencies."

I am trying control this by working with my "stories" module/stack, by just using two script

	# always "on" like a library/backscript, get stuff of disk
	# which is assigned to the stack, handled the UI/UX for stack

This approach requires a lot "Switch cases" as you may be targeting the UI/UX of many different groups  on the card or different cards. 

So far I am happy that I am having to  debug  just two scripts to manage "everything" 

But I have question on "closeControl" for which there may be many groups on a single card

is it "Switchable?"  and can we use it in a single behavior that "looks at"  many groups on one card?

on closeControl pControl
	switch pControl
		case "homeStory"
			setPref "preferences/modules/portal/story/storyTitle", pStoryTitle
			setPref "preferences/modules/portal/story/storyScene/", sLastScene
		case "storyMenu"
			put empty into fld "storyMenuFld"
		end switch
end closeControl

Of I can hack around and find out if it works. But I am thinking over otherd have 
"been here, done that". an have some advice...

We might as well use "on closeCard" 

any thoughts?

More information about the use-livecode mailing list