Constant command

Phil Davis revdev at pdslabs.net
Thu Oct 14 16:06:06 EDT 2010


  On 10/14/10 12:26 PM, J. Landman Gay wrote:
> On 10/14/10 11:28 AM, DunbarX at aol.com wrote:
>> About the constant command that Phil used in his process gadget. What does
>> it do that a variable does not? I see it cannot be altered in the same
>> handler, and I see that it can overRide a built-in constant, which might be
>> useful. Anyone ever come up with a compelling reason to use such a thing?
>
> In Phil's example a variable would work just as well. I use constants more 
> often at the top of scripts.

Me too.
>
> In the case of scripts, local variables have to be set at some point before 
> they will have a value, so I use those for things that are specific to the 
> user setup (file paths I'll need repeatedly, for example.) Constant values are 
> permanent until you change the script, so they're good for things that rarely 
> change, like version numbers, lists of related objects you need to loop 
> through often, and other script-related uses.
>
> I almost never use constants inside a handler, but that's just personal style.

Me neither.

-- 
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net




More information about the Use-livecode mailing list