Trust me to always turn up a bug.
Thanks guy's for your help, much appreciated.
On a side note i did try writing it the other way but i must have been entering it in wrong becaus eit keep bringing up a message saying the parameters were wrong.
I know when i start typing in global('whatever') a hint box appears telling me how to complete the command parameters, but this didnt.
Unless i've missed something it would be an enormous help to have an example appear in the expression editor window when you type ina command. As it happens all i had was "distance (distance)", which wasent much help.