I think this can be simpler:

return (pValue is an integer) AND (pValue >= 0)

Obviously, if it's an integer, it's also a number, and in this context it might be better to avoid 'trunc' since in some circumstances, (there is a thread from a while back about this) trunc returns a non-integer result.

I'm still not clear on whether zero is positive, though, especially since we can have -0 and +0 apparently, though being mathematically unsophisticated I'd have thought them equal, except to a dumb computer!

Best,

Mark

On 5 Oct 2006, at 01:13, [EMAIL PROTECTED] wrote:

function  isPositiveInteger pValue
return (pValue is a number) AND (pValue >=0) AND (trunc(pValue) =pValue)
end isPositiveInteger

_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to