quote:
It's not about enforcing a method but rather producing quidelines for a standard way of doing it if you want to
{EDIT} Pre-coffee rant deleted {/EDIT}

The ideal solution would be if a function returned an object whose properties are (say):
quote:
$oResult.ERROR
$oResult.SERROR
$oResult.Value

If the default property/method (I'm not that familiar with objects) is the $oResult.Value, then the functions would continue to work as they currently do, i.e.
code:
Function udfSetString()
$udfSetString="A String"
EndFunction
;
; Call function
udfSetString() ?

When called the function will return "A String" as you'd expect.
However if you wanted you could use the other properties:
code:
Function udfDivide($iDividend,$iDivisor)
If Val($iDivisor)=0
$udfDivide.ERROR=1
$udfDivide.SERROR="Whoa! caught a divide-by-zero error in udfDivide()"
Else
$udfDivide=Val($iDividend) / Val($iDivisor)
EndIf
Exit $udfDivide.ERROR
EndFunction

This way if someone else uses your function and doesn't care about the extra information they can still assign the return value and get the expected "natural" result.

[ 17 April 2002, 11:13: Message edited by: Richard Howarth ]