cross-stack globals, also, file inclusion
Stephen Quinn Barncard
stephenREVOLUTION at barncard.com
Wed Oct 22 21:44:21 EDT 2003
But wouldn't a custom property, which can only be modified using the
IDE, a script or the message box be more of what you want than a
constant (which would have to be defined anyway in a script which
would have to be run) ?
The property is just there, with nothing to do to set it, and
nothing's going to accidentally clear or change it. All you have to
do is read it. Just make the script only read, not write. Voila! a
"fake" constant. How more 'constant' can a user property be?? --
we're just moving data around in a stack, whether it's a script, a
field, or a property, it doesn't matter what it's called if it works.
You could even load it in on startup..
global arnoldConstant
on openstack
put the arnold of this stack into arnoldConstant
pass openstack
end openstack
doesn't this make a 'constant global'? -- One has to trust one's own
code somewhere, even if you had constants in Rev, they wouldn't be
any different than a variable as far as Rev cares -- it's still
places data in memory, and if memory gets screwed up, it's over
anyway and we restart...
>On Wednesday, October 22, 2003, at 05:36 PM, Stephen Quinn Barncard wrote:
>
>>Please excuse the obvious, but can't a custom property, say in the
>>main stack, act as a global constant? Set it in the IDE and it
>>will persist through standalone creation forever...
>
>Nope, the custom property can be modified in the standalone. You
>just can't *save* the standalone stack. I wasn't sure about this, so
>this was my test script that I built into a standalone:
>
>
>But we can use custom properties or globals "as constants", if we
>trust ourselves not to break their constant-ness by modifying them.
>But actual constants would be better because they are idiot-proof
>(referring to myself there)
>
More information about the use-livecode
mailing list