I would agree, but I have become fond of constants, especially in objects where
code is similar but need certain things to be different. For instance I have a
button bar which opens for edit, creates new form, deletes data, saves data
etc. I copy this bar to each of my forms. The code in most
g stack
> "fastJSONlib"
> end releaseStack
>
> note that using "is among" and "is not among" is not optional otherwise you
> end up in an infinite loop
>
>
>
> -
> ---
> Greg (pink) Miller
> mad, pink and dangerous to code
>
using stack
"fastJSONlib"
end releaseStack
note that using "is among" and "is not among" is not optional otherwise you
end up in an infinite loop
-
---
Greg (pink) Miller
mad, pink and dangerous to code
--
View this message in context:
http://runtime-revolution.
Thanks Ali, that's a nice idea.
But just in case anyone else does the same as me (i.e. copy/paste it
without looking too hard :-) :
there should NOT be an 'else' clause in there right now it will
either set the variable OR do the initialization, when in fact it should
do BOTH or
One simple way to make this slightly nicer would be to make sure all your
initialisation happens in a separate handler eg (doLibraryInitialization),
and use your script local lock in the libraryStack handler
> local sIHaveBeenInitialized
> on librarystack
> if sIHaveBeenInitialized is empty
On 5/13/17 6:29 PM, Alex Tweedly via use-livecode wrote:
all initialisation would be done in the librarystack handler
that handler would also set a script-local variable to avoid repeated
initialisation
so something like
local sIHaveBeenInitialized
on librarystack
if sIHaveBeenInitialized
I'm starting to make more use of library stacks (partly because I'm
trying to switch away from revIgniter to a CGI-based solution to allow
me to do more work & debugging in the IDE).
And now I'm looking for best-practice and/or suggestions for how to use
library stacks. The