hmmm... that seems to have fixed it in that example code, but when I paste those paras back into my main program it starts moaning again at those exact lines.
I get the feeling I'm going to have to start again from a blank sheet of vi. ;-(
Thanks for dropping by with your thoughts.