No you are right, I tried this in Aptana and it works.
The code I am writing is in an MVC 3 framework, which I now assume is the problem, althoughI am not sure what to do about it.
Thanks for your help, I'll check this as answered although I still have the problem! // Jason