Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorsuthern
    • CommentTimeDec 6th 2007 edited
     
    Ok, I've got an odd one. In trying to create complex associations, I ran across the following:

    This does not return any errors:
    var $has_many = "conditions,spots,parts_vendors,groups,groups_parts,vendors";

    But THIS does:
    var $has_many = "conditions".",spots,parts_vendors,groups,groups_parts,vendors";
    Error: Parse error: syntax error, unexpected '.', expecting ',' or ';' in...

    My question is WHY? Is it impossible to declare concatenated variables? I know in regular string handling, ("cat"." that") = ("cat that"). Hmm. Learn something new every day I guess.

    And now I feel dumb for asking this question. Is there a way to delete it?
    • CommentAuthoraekko85
    • CommentTimeAug 19th 2008 edited
     

    From what I experienced, it is not possible to declare variables while evaluating expressions.

    Meaning :

     var $foo = 2;         //ok
     var $foo = 1 + 1;     //syntax error
    

    I don't know why and find it quite annoying.

    • CommentAuthorsuthern
    • CommentTime2 days ago
     

    Perhaps it has historical reasons. Who knows.

Add your comments
    Username Password
  • Format comments as