{Comparisons} in [showif] vs. [if] Bug? Inconsistency?

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 46364
interpreted = N
texte = on 12/17/02 12:54 PM, Dan Strong at webdna@stronggraphicdesign.com so noted...> [text show=f]duedate=12/18/2002[/text] >
> Payment is due on: [duedate]
> Today's date is: [date]
>
> [SHOWIF {[duedate]}>{[date]}]ACCOUNT IS CURRENT[/SHOWIF] > [SHOWIF {[duedate]}={[date]}]ACCOUNT IS DUE TODAY[/SHOWIF] > [SHOWIF {[duedate]}<{[date]}]ACCOUNT IS OVER DUE[/SHOWIF] >
This brought up an interesting point. I was wondering if the whole [math]{[duedate]}[/math]>[math]{[date]}[/math] thing was still needed in [showif] after the [if] context was introduced. It turns out that they don't operate identically.[if {[duedate]}<{[date]}][then]ACCOUNT IS OVER DUE[/then][/if]Works if [duedate] = 02/01/2002 or 2/1/2002.[showif {[duedate]}<{[date]}]ACCOUNT IS OVER DUE[/showif]Works ONLY if [duedate] = 02/01/2002. It fails if [duedate] = 2/1/2002.For real fun, try this code:[loop start=1&end=12][math show=f]month=[index][/math] [loop start=1&end=31] [showif {[month]/[index]/2002}<{12/31/2002}][month]/[index]/2002 is less
[/showif] [showif {[month]/[index]/2002}>{12/31/2002}][month]/[index]/2002 is more
[/showif] [/loop][/loop]Some (most) dates fail, others don't. Same code works as expected when written with [if].... or is this one of the cases where the doctor says well, don't do that and [showif] isn't *supposed* to operate the same as [if] when it comes to {dates}? : )Mac PI v4.5.0 Rob Marquardt Designer/Resident Wirehead Toast Design800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. {Comparisons} in [showif] vs. [if] Bug? Inconsistency? (Rob Marquardt 2002)
on 12/17/02 12:54 PM, Dan Strong at webdna@stronggraphicdesign.com so noted...> [text show=f]duedate=12/18/2002[/text] >
> Payment is due on: [duedate]
> Today's date is: [date]
>
> [SHOWIF {[duedate]}>{[date]}]ACCOUNT IS CURRENT[/SHOWIF] > [SHOWIF {[duedate]}={[date]}]ACCOUNT IS DUE TODAY[/SHOWIF] > [SHOWIF {[duedate]}<{[date]}]ACCOUNT IS OVER DUE[/SHOWIF] >
This brought up an interesting point. I was wondering if the whole [math]{[duedate]}[/math]>[math]{[date]}[/math] thing was still needed in [showif] after the [if] context was introduced. It turns out that they don't operate identically.[if {[duedate]}<{[date]}][then]ACCOUNT IS OVER DUE[/then][/if]Works if [duedate] = 02/01/2002 or 2/1/2002.[showif {[duedate]}<{[date]}]ACCOUNT IS OVER DUE[/showif]Works ONLY if [duedate] = 02/01/2002. It fails if [duedate] = 2/1/2002.For real fun, try this code:[loop start=1&end=12][math show=f]month=[index][/math] [loop start=1&end=31] [showif {[month]/[index]/2002}<{12/31/2002}][month]/[index]/2002 is less
[/showif] [showif {[month]/[index]/2002}>{12/31/2002}][month]/[index]/2002 is more
[/showif] [/loop][/loop]Some (most) dates fail, others don't. Same code works as expected when written with [if].... or is this one of the cases where the doctor says well, don't do that and [showif] isn't *supposed* to operate the same as [if] when it comes to {dates}? : )Mac PI v4.5.0 Rob Marquardt Designer/Resident Wirehead Toast Design800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Rob Marquardt

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

details (2003) Missing Cart Information (2003) [WebDNA] paypal (2009) Emailer (WebCat2) (1997) Errant Email. (1998) [searchString] (1997) How To question on setting up downloads (1997) Multiple security dbs (1997) Press Release hit the NewsWire!!! (1997) [SHOWIF AND/OR] (1997) OUTSIDE LINKS TO SHOW SHOPPING CART????????? (1998) vs (1997) Roundup function? (1997) [WebDNA] WebDNA slow processing (2011) suffix mapping, use of cache, etc. (1997) Loss in Form (1998) [searchString] (1997) [delete] problem (1997) Webstar 1.3.1 PPC (1997) [sendmail] sending twice... (Update) (2003)