Can anyone enlighten me as to why the following script throws the error
Invalid Assignment: '=' expected near 'ceiling' at line4, column 16 in the vbscript editor of the report designer.
I have tested the script in vbsedit and other compilers substittuting a real value for the one it might derive from the repoty and it works perfectly, so why does the report designer not like the function?
Function Ceiling(byval n)
on error resume
on error goto 0
f = Floor(n)
Ceiling = n
Exit Function
Ceiling =
Function Floor(byval n)
Floor =
End
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