|
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Sat Jul 03, 2010 9:34 pm
[3.22] BUG? #addkey 1 2 3 fails. |
#addkey doesn't accept numbers, even in quotes, for variable names.
Examples:
Code: |
#addkey 1 2 3
#addkey "1" "2" "3"
#addkey "1" "two" "three" |
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sat Jul 03, 2010 11:54 pm |
A variable name can not begin with a number or an '_'. There are few others I believe, you special chars etc.
|
|
_________________ Asati di tempari! |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Jul 04, 2010 12:02 am |
Variable names most certainly can begin with an _, though I don't think it's really advised. As far as numbers go, Tech is correct about that. Especially now with the "by reference" option, you don't want to do something like: #CALL %additem(1, test) and have it send the variable 1 to test instead of the number 1.
Charneus |
|
|
|
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Sun Jul 04, 2010 1:45 am |
Mmm, I guess I wasn't aware of this. I certainly knew you couldn't use numbers as the names of aliases.
Also, Char, wouldn't only the 2nd argument in %additem ever be a variable reference? |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Jul 04, 2010 1:49 am |
Good point, GS. Hadn't thought about that.
I remember bringing up the use of numbers as aliases, though, which screwed up scripts because %eval no longer worked. If I had an alias of 1, %eval(10-1) would return nothing. Oh well.
CHarneus |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jul 06, 2010 5:04 pm |
You definitely should not use numbers for variable names.
|
|
|
|
|
|