Well in answer to my own question and possibly to save anyone else wasting a heap of time on something like this it turns out that the C1 Reports vbscrit editor doesn't like functions, sub routines,arrays or case staements.
If anyone from C! reads this perhaps they could see if a large and prominennt note to that effect gets put into the help documentation. It would I suspect save several people hours of time.
Just in case anyone out there see's the code I posted in the first post and thinks to themselves that a ceiling or floor function would be realluy useful in their reports then you can achieve the same with the following:
Ceiling function
-Int(-dividend/divider)
Floor Function
Int(dividend/divider)
Hope this helps someone and saves them a few hours.
Dom