Strict Compile Mode

Peter Haworth pete at lcsql.com
Tue Oct 9 13:07:19 CDT 2012


Thanks Ben, those are interesting conventions.  I hadn't come across the
extra prefix to denote the data type of the variable, although I have seen
a convention where the letter "a" is appended to array variables.
Pete
lcSQL Software <http://www.lcsql.com>



On Tue, Oct 9, 2012 at 10:14 AM, Ben Rubinstein <benr_mc at cogapp.com> wrote:

> I use t as prefix for variables containing text, which in the nature of
> LiveCode is most of them, but allows me to distinguish i for integers, b
> for booleans, a for arrays.
>
> I use s as prefix for script locals, g for globals, and k for constants.
>
> Hence "sbKiosk" is a script-local variable whose value should be a
> boolean; "gaObject2Nationality" is a global variable whose value should be
> an array (and an array in which key is something that I'll understand by
> 'Object', the value as something which I'll recognise as Nationality);
> "tTerms" is a local variable with a string value.
>
> Some people use "p" as a prefix for parameters in a function/handler - I
> think I probably should, but somehow I'm too old to change my ways now - if
> I did, I'd use it in addition to the type letter, eg now I know that
> "tTerms" is a local string variable, but can't tell if I declared it in the
> function body or if it was a parameter - "ptTerms" would be more explicit
> in that regard, and perhaps if I was really good I'd use "rtTerms" to
> indicate that it was a parameter passed by reference, which is arguably a
> more useful distinction to be aware of
>


More information about the use-livecode mailing list