I think the issue of function call conventions might be a complex issue.Function (UDF) calls are a powerful addition to Kixtart that allow the development of modular,independant & reusable code but in most programming languages a more general subroutine call is also supplied. This allows more complex modular scripts to be written & it allows one to return extra values beside the function value - such as an error or a status codes.
Richard H. showed in the link below that Ruud implemented UDFs in a manner that allows us to use UDFs as if they were either/or functions or subroutines.
Richard's suggestion
Allowing people to use this type of calling convention will greatly increase the type of things that can be done in a UDF but it will make calling conventions much harder to define and document.
If we allow this type of convention I think it might violate Bryce's suggested rule of:
quote:
All information passed back out from a UDF should be passed via the return variable (UDF name).
Whatever route is chosen I think we need a well defined template posted so others can follow it. Maybe Martijn, you would like to post a first shot at it using everyone's suggestions. I suggest you make the template read only & the rest of us could offer changes in this discussion or in another discussion that allows us to post comments. You could then accept revisions to the template as you see fit.
[ 10 November 2001: Message edited by: JackLothian ]