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

Protect vs Authenicate (1997) [Sum] function? (1997) Search/sort in URL Was: GuestBook example (1997) Sort Order on a page search (1997) pictures / referrer etc. (1998) NT or Mac (1997) Share cost of training videos! (1998) Help name our technology! I found it (1997) [WebDNA] Local Development On Windows 8.1 (2015) emailer (1997) FileMaker and WebCat (1999) WebCatalog on G3 Macs? (1997) Form Submition (2003) Giving out error pages (1997) Now you see it now you donīt (1997) OT Hosting Q again. (2002) Filemaker Pro & Webcatalog (1999) [taxRate] [TaxTotal] ? (1997) [WebDNA] Can't see were it's wrong.... (2017) Search/sort in URL Was: GuestBook example (1997)