{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:

Stumpted Again (1997) real beginner stumped (2000) New public beta available (1997) WebCat, switching from NT to OSX (2003) [fileinfo . . .] (2000) Shopping carts and reloading pages (1997) Workaround for Emailer doubled bcc messages (1998) Hiding HTML and page breaks (1997) WebCat and AppleShare 6.0 (1998) [WebDNA] [raw] tag with [interpret] question (2010) Building Calendars (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Vanity counter side note (1998) Search/sort in URL Was: GuestBook example (1997) is [Bankres] an internal webcat variable? (1999) Requiring that certain fields be completed (1997) Help name our technology! (1997) Display [price] in banner ad (1998) Too Much Info (1998) [OT] Appropriate Signature??? (2003)