On Aug 11, 2007, at 11:41 PM, Paul McNett wrote:

> You can actually do:
>
> (pennies == 1) and "penny" or "pennies"
>
> It's pretty obtuse, but it comes in handy when you just need the
> one-liner, such as in an expr in the report writer.

        Except for the fatal flaw of that construct: it doesn't work with  
all values.

        Let's say that you want to include a $4.99 fee in your app, but if  
the person is a member of a certain group, you want to waive the fee.  
So you write:

(person in group) and 0 or 4.99

        This makes the problem obvious; when you have variable names in the  
expression instead of an explicit zero, it's harder to catch.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to