Characters in names

Graham Samuel livfoss at blueyonder.co.uk
Mon Mar 21 06:05:53 EST 2005


On Sun, 20 Mar 2005 18:39:02 -0800,  "Jeanne A. E. DeVoto"  
<revolution at jaedworks.com> wrote:
>
> This is from "About containers, variables, and sources of value":
>
> Variable names
> The names of variables must consist of a single word and may contain
> any combination of letters, digits, and underscores (_). The first
> character must be either a letter or an underscore.
>
> Here are some examples of legal variable names:
>
>    someVariable
>    picture3
>    my_new_file
>    _output
>
> Here are some names that cannot be used as variable names:
>
>    3rdRock     -- starts with a digit
>    this&That   -- "&" cannot be used
>    My Variable -- more than one word
>
> Avoid giving a variable the same name as a custom property. If you
> refer to a custom property, and there is a variable by the same name,
> Revolution uses the contents of the variable as the name of the
> custom property. Generally this will produce unexpected results.
>
>    Note:  Global variables whose names begin with "gRev" are reserved
> by the Revolution development environment.
>
>
>
> (As Alex notes, there are characters other than letters, numbers, and
> underscores that will work in variable  names, but this isn't
> guaranteed to go on working, so those characters are best avoided.)
> --  
Thanks Jeanne, and everyone else who replied. I will stick to  
underscore as my 'non-alphanumeric' character (I happen to need one). I  
am sorry there isn't a true reference description of the language. If  
such a thing existed, it would not only tell us about variable names  
but would also tell us about naming other things like stacks and  
fields, which may or may not be be "any string". Can I have a field  
called "?? AB_&#" for example? Don't worry, I don't really want one!

A note on the RR online documentation:

Although it does appear logical that this info should appear in "About  
containers, variables, and sources of value", my attempts to find  
"names" in the docs didn't work, nor could I find a synonym that led  
directly to the info Jeanne has revealed - and yet it was there. I  
guess the dictionary only covers the language description and not the  
topics part of the docs, but the topics search wasn't much help either  
(and the searching was incredibly slow on my G5 iMac). As ever, it's  
knowing how to find the information that is tricky - thank goodness for  
this list!

Graham
------------------------------------------------------------------------ 
---
Graham Samuel / The Living Fossil Co. / UK and France



More information about the use-livecode mailing list