[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Using the cond function wit



> Your error is occuring on the following line with the last parameter: 90/#t1
> 
>     let #val = cond(trunc(#t1,0) = 0,0,90/#t1)
> 
> Since #t1 = 0, the division can't be calculated.


It doesn't seem week documented in my version of the SQR manual, but it
appears that *all three* parameters of "cond" are evaluated before cond is
invoked.  In other words, "cond" is a function, not an execution-control
statement, and all of it's parameters must be valid.

In order to work around this, you might try 
  let #val = cond(trunc(#t1, 0) = 0, 0 , 90/cond(trunc(#1, 0) = 0, 1, #t1))

Note that the "1" could be anything (except 0), since the value of the
90/cond(...) stuff is never used if #t1 = 0.

						Nathan

----------------------------------------------------------------------------
Nathan Treadway    | Ray Ontko & Co. | info@ontko.com (auto-reply server)
nathant@ontko.com  | Richmond, IN    | ftp.ontko.com:/users/ontko (anon ftp)