Re: I love ternary ifs, don't you?

2008-11-19 Thread Ricardo Aráoz
Ed Leafe wrote: On Nov 18, 2008, at 4:43 PM, Paul McNett wrote: But yes, I love iif(), and wish Python had it. def iif(comp, trueVal, falseVal): return {True: trueVal, False: falseVal}[bool(comp)] I think that was one of the first Python scripts I ever wrote!

I love ternary ifs, don't you?

2008-11-18 Thread Matt Slay
I just love this: llNonCust=iif(alltrim(QuoteInf.cust_num)=='NONE', .t., .f.) Rather than: If alltrim(QuoteInf.cust_num)=='NONE' llNonCust=.t. else llNonCust=.f. endif --- StripMime Report -- processed MIME parts ---

RE: I love ternary ifs, don't you?

2008-11-18 Thread Tracy Pearson
Or llNonCust = ( alltrim(QuoteInf.cust_num)=='NONE' ) -Original Message- From: Matt Slay Sent: Tuesday, November 18, 2008 5:03 PM I just love this: llNonCust=iif(alltrim(QuoteInf.cust_num)=='NONE', .t., .f.) Rather than: If alltrim(QuoteInf.cust_num)=='NONE'

Re: I love ternary ifs, don't you?

2008-11-18 Thread Ed Leafe
On Nov 18, 2008, at 4:02 PM, Matt Slay wrote: llNonCust=iif(alltrim(QuoteInf.cust_num)=='NONE', .t., .f.) You like that better than: llNonCust = (ALLTRIM(QuoteInf.cust_num) == NONE) -- Ed Leafe ___ Post Messages to: ProFox@leafe.com

Re: I love ternary ifs, don't you?

2008-11-18 Thread Paul McNett
Ed Leafe wrote: On Nov 18, 2008, at 4:43 PM, Paul McNett wrote: But yes, I love iif(), and wish Python had it. def iif(comp, trueVal, falseVal): return {True: trueVal, False: falseVal}[bool(comp)] I think that was one of the first Python scripts I ever wrote! I know I

Re: I love ternary ifs, don't you?

2008-11-18 Thread Ed Leafe
On Nov 18, 2008, at 6:42 PM, Paul McNett wrote: I know I could write it; I wish it were built-in. I know you could write it, too; I was just pointing out that my first instinct in Python was to mimic the way Fox worked. Since then I've come to appreciate that it isn't built-in.

Re: I love ternary ifs, don't you?

2008-11-18 Thread Paul McNett
Ed Leafe wrote: On Nov 18, 2008, at 6:42 PM, Paul McNett wrote: I know I could write it; I wish it were built-in. I know you could write it, too; I was just pointing out that my first instinct in Python was to mimic the way Fox worked. Since then I've come to appreciate that

Re: I love ternary ifs, don't you?

2008-11-18 Thread Jeff Johnson
Kind of like play-doh, huh? That was a great article, by the way. Jeff Jeff Johnson [EMAIL PROTECTED] SanDC, Inc. 623-582-0323 Fax 623-869-0675 Phoenix Python User Group - [EMAIL PROTECTED] Ed Leafe wrote: On Nov 18, 2008, at 4:43 PM, Paul McNett wrote: But yes, I love iif(), and wish