[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: snmpconf

On Wed, 25 Oct 2000 17:58:47 -0500, Mike_Ayers@bmc.com wrote:
 >{ exists()} 9.) This function and many following
 >return 1 for success and 0 for failure, the reverse of the C

Not so. In a boolean context, C defines false as zero and true as 1. 
(Actually, any non-zero value is true). The exists() function (and most of 
the other boolean functions) do not return success and failure (which are 
not defined in C) but true or false. If you were to write:

   if (exists(""))

you would expect blah() to be executed if exists. Exists must 
return non-zero (true) for this situation.  Compare to Standard C:

   if (is_upper(c))

will execute blah() if is_upper() returns 1, i.e. if c is an upper-case letter.

- Pablo
Pablo Halpern                                    phalpern@newview.org