Page 1 of 1

Variable prefix in examples

Posted: Fri Mar 27, 2015 6:14 pm
by seaniepie
Hi All,

So we are used to the prefixes of t(temp), p(parameter), g(global), s(script-wide) and k(konstant) in Variables (or constants in the case of k). In Livecode builder scripts though I have notices the 'm' prefix. Just wondering what that symbolised.

Thanks
Pi

Re: Variable prefix in examples

Posted: Fri Mar 27, 2015 7:08 pm
by LCMark
@seaniepie: We use 'm' in widget scripts to indicate a 'member' variable. It signifies that there is one copy of the variable per instance of the widget. We use 's' in library scripts as there is only one copy - as libraries are global. The reason for the distinction is that we will be changing things slightly so widgets will be definitions in a library, and thus a widget will have access to both its 'member' variables and variables of the library it is defined in.

Re: Variable prefix in examples

Posted: Thu Apr 02, 2015 9:53 am
by peter-b
seaniepie wrote:So we are used to the prefixes of t(temp), p(parameter), g(global), s(script-wide) and k(konstant) in Variables (or constants in the case of k). In Livecode builder scripts though I have notices the 'm' prefix. Just wondering what that symbolised.
Just a note: you can call your variables anything you like, but we recommend using the prefixes you mention because it helps understand what sort of variables the code is using.