> A "syntax error" on the last line almost always indicates a missing
> "end".  Get in the habit of checking that first when you see the 
> complaint.  In this case, I believe you meant:
>

I had considered that possibility, but in other languages the missing 'end' 
marker tends to result in an error message closer to the mistake, and so I 
didn't look back far enough through the code.

Thanks very much for your help.

Greg