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

plus sign giving me problems in convertchars (2005) [WebDNA] Cacheing include files (2015) The Form authentication trick (2000) lazy programming (2000) WebCatalog for Postcards ? (1997) Return records from another (1997) question: back button prevention (1997) Server crash (1997) New Featured Site (1999) Allowed fields in formulas.db (1998) Multi-processor Mac info ... (1997) OT: JavaScript Question (well... Using WebCat with it too) (2001) access denied problem (1997) [WebDNA] Is the AutoCommit preference still supported? (2010) Question about replacing words (1998) Running 2 two WebCatalog.acgi's (1996) webcat (2000) WebTV (1998) Shared conversion under WebTen (1998) NumFound (1999)