Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Configuration var names

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
rabol
Smarty Rookie


Joined: 07 Jan 2004
Posts: 11

PostPosted: Wed Jan 07, 2004 12:19 pm    Post subject: Configuration var names Reply with quote

Hi

I a project that I'm working on I use the Config_File class to read language strings for my application.

Why can't I have var names starting with numbers ?
eg. 1_var = "test", gives this error:
Warning: Config_File error: Bad variable name '1_var' in c:\www\test\www\include\smarty\libs\Config_File.class.php on line 360

Thanks in advance.
Steen
Back to top
View user's profile Send private message Send e-mail
tk
Smarty Regular


Joined: 31 Oct 2003
Posts: 49
Location: London, UK

PostPosted: Thu Jan 08, 2004 12:16 am    Post subject: Reply with quote

Isn't this the same for PHP and (most?) other languages too?

Hazarding a guess.. it's because $1 through $9 have special meanings.

FWIW, I get the same for Perl too:

Code:
[tk@hybris:~]$ perl -e '$1_var = "test"; print $1_var;'
Bareword found where operator expected at -e line 1, near "$1_var"
        (Missing operator before _var?)



HTH =)



Regards,

tk
_________________
Certified Code Junkie(tM)
Copyleft (L) two thousand and now, tk
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Jan 08, 2004 7:54 am    Post subject: Reply with quote

it's a common limititation to have to have identifiers start with a letter. most programming languages and a lot of file-formats do so.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP