Characters in names

Scott Rossi scott at tactilemedia.com
Sun Mar 20 20:22:04 EST 2005


Recently, Graham Samuel  wrote:

> I can't find a list in the RR docs of legal characters for variable
> names. Obviously letters of the alphabet (at least the ascii version)
> and the numerals are OK, plus hyphen and underscore - but what else?
> Clearly no character used as an operator, like \ or +, can be legal,
> but maybe some others are: for example is period (full stop to me)
> permitted? If I've missed a complete list, can someone please point me
> at it?

FWIW, I can tell you I've used "?" as a prefix character without problems,
but it has been said that the MC/Rev engineers might use this character in
the future for the engine.  Also, I would recommend NOT using a standard
hyphen "-" unless you explicitly quote your names since the engine assumes
this to be negative or subtract and will try to evaluate the name as an
expression.

In my own work, I prefix almost everything with an underscore: object names,
custom properties, etc.  This allows me to quickly identify my objects/names
and also use the equivalent of reserved words (ie _hilite, _top, _max, etc)
without having to worry about reserved name conflicts.  Some folks have
argued that you can't use a double click to select the entire word/name in a
script when using this convention, but this is irrelevant since the
underscore is used as a non-changing character.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com



More information about the use-livecode mailing list