Re: [WebDNA] IF statement evaluation bug report, WebDNA 8.5.1

This WebDNA talk-list message is from

2019


It keeps the original formatting.
numero = 114942
interpreted = N
texte = 2570 --Apple-Mail=_1D9C7994-F043-4DD6-8F1B-6361EB9E4347 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Shouldn=E2=80=99t matter, Scott. One expression evaluates TRUE, the = other FALSE. TRUE & FALSE =3D FALSE > On Oct 29, 2019, at 11:03 AM, Scott @ Itsula = wrote: >=20 > Evaluates strings prior to numbers? > =20 > From: Brian Fries > Sent: 29 October 2019 17:59 > To: WebDNA Talk > Subject: [WebDNA] IF statement evaluation bug report, WebDNA 8.5.1 > =20 > I=E2=80=99ve identified a bug with IF statement evaluation. My setup: >=20 > Product: WebDNA - Enterprise Edition > Version: 8.5.1 > Platform: unix-Macintosh OS X > Server OS: macOS 10.12.6 (16G2016) >=20 > Also tested on: > Product: WebDNA - Enterprise Edition > Version: 8.5.1 > Platform: unix-Macintosh OS X > Server OS: macOS 10.14.6 (18G87) >=20 > And on: > Product: WebDNA (FastCGI) > Version: 8.5.1 > Platform: linux unix 64bits > Server OS: Ubuntu 14.04.5 LTS >=20 >=20 > I can code around the bug, so I don=E2=80=99t need suggestions for = other ways to achieve my goals, I=E2=80=99m just reporting inconsistent = and incorrect behavior by WebDNA. >=20 > My code was testing for the presence of a page parameter which should = either not be present or should have a numeric value greater than zero, = depending on how the user got to the page: >=20 > [if ([pParam]>0)][then] > * Got good parameter > [/then][else] > * No parameter, or invalid parameter > [/else][/if] >=20 > This worked fine, until I added an additional expression to the IF = statement: >=20 > [text]list=3Done,two,three[/text] > [if ("[list]"^"one") & ([pParam]>0)][then] > TRUE * Got good parameter > [/then][else] > FALSE * No parameter, or invalid parameter, or list does not contain = =E2=80=9Cone" > [/else][/if] >=20 > This example ALWAYS goes to the TRUE clause, unless the first = expression fails. Whether the second expression is TRUE or FALSE = doesn=E2=80=99t matter. >=20 > For debugging, I simplified the components until I got to this, which = incorrectly executes the TRUE clause: >=20 > [if (2=3D2) & (ABC>0)][then] > TRUE > [/then][else] > FALSE > [/else][/if] >=20 > Testing the individual expressions, they both work correctly. (2=3D2) = executes the TRUE clause, while (ABC>0) executes the FALSE clause: >=20 > [if (2=3D2)][then] > TRUE > [/then][else] > FALSE > [/else][/if] >=20 > [if (ABC>0)][then] > TRUE > [/then][else] > FALSE > [/else][/if] >=20 >=20 > Interestingly, switching the order of the expressions, correctly = evaluates to the FALSE clause: >=20 > [if (ABC>0) & (2=3D2)][then] > TRUE > [/then][else] > FALSE > [/else][/if] >=20 >=20 > Thanks, > Brian Fries >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list = talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: = http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: = support@webdna.us > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list = talk@webdna.us To unsubscribe, E-mail to: = talk-leave@webdna.us archives: = http://www.webdna.us/page.dna?numero=3D55 = Bug Reporting: = support@webdna.us --Apple-Mail=_1D9C7994-F043-4DD6-8F1B-6361EB9E4347 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Shouldn=E2=80=99t matter, Scott. One expression evaluates = TRUE, the other FALSE. TRUE & FALSE =3D FALSE

On Oct = 29, 2019, at 11:03 AM, Scott @ Itsula <scott@itsula.co.uk> = wrote:

Evaluates = strings prior to numbers?
 
From: Brian Fries
Sent: 29 = October 2019 17:59
To: WebDNA Talk
Subject: [WebDNA] IF statement = evaluation bug report, WebDNA 8.5.1
 
I=E2=80=99ve identified a bug with IF statement evaluation. = My setup:

Product: WebDNA - Enterprise Edition
Version: 8.5.1
Platform: unix-Macintosh= OS X
Server OS: macOS 10.12.6 (16G2016)

Also tested on:
Product: WebDNA - Enterprise Edition
Version: 8.5.1
Platform: unix-Macintosh= OS X
Server OS: macOS 10.14.6 (18G87)

And on:
Product: WebDNA (FastCGI)
Version: 8.5.1
Platform: linux unix = 64bits
Server OS: Ubuntu 14.04.5 LTS


I can code around the bug, so I don=E2=80=99t need = suggestions for other ways to achieve my goals, I=E2=80=99m just = reporting inconsistent and incorrect behavior by WebDNA.

My code was testing for = the presence of a page parameter which should either not be present or = should have a numeric value greater than zero, depending on how the user = got to the page:

[if ([pParam]>0)][then]
* Got good parameter
[/then][else]
* No parameter, or invalid = parameter
[/else][/if]

This worked fine, until I added = an additional expression to the IF statement:

[text]list=3Done,two,three[/text]
[if ("[list]"^"one") & = ([pParam]>0)][then]
TRUE * Got good = parameter
[/then][else]
FALSE * = No parameter, or invalid parameter, or list does not = contain =E2=80=9Cone"
[/else][/if]
This example ALWAYS goes to the TRUE = clause, unless the first expression fails. Whether the second expression = is TRUE or FALSE doesn=E2=80=99t matter.

For debugging, I simplified the = components until I got to this, which incorrectly executes the TRUE = clause:

[if (2=3D2) & (ABC>0)][then]
TRUE
[/then][else]
FALSE
[/else][/if]
Testing the = individual expressions, they both work correctly. (2=3D2) executes the = TRUE clause, while (ABC>0) executes the FALSE clause:

[if (2=3D2)][then]
TRUE
[/then][else]
FALSE
[/else][/if]

[if (ABC>0)][then]
TRUE
[/then][else]
FALSE
[/else][/if]


Interestingly, switching the order of the expressions, = correctly evaluates to the FALSE clause:

[if = (ABC>0) & (2=3D2)][then]
TRUE
[/then][else]
FALSE
[/else][/if]


Thanks,
Brian Fries

--------------------------------------= ------------------- This message is sent to you because you are = subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us = archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: = support@webdna.us
--------------------------------------------------------- = This message is sent to you because you are subscribed to the mailing = list talk@webdna.us To unsubscribe, E-mail = to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us

= --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --Apple-Mail=_1D9C7994-F043-4DD6-8F1B-6361EB9E4347-- . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] IF statement evaluation bug report, WebDNA 8.5.1 (Brian Fries 2019)
  2. RE: [WebDNA] IF statement evaluation bug report, WebDNA 8.5.1 ("Scott @ Itsula" 2019)
  3. Re: [WebDNA] IF statement evaluation bug report, WebDNA 8.5.1 (Donovan Brooke 2019)
  4. Re: [WebDNA] IF statement evaluation bug report, WebDNA 8.5.1 (Brian Fries 2019)
  5. RE: [WebDNA] IF statement evaluation bug report, WebDNA 8.5.1 ("Scott @ Itsula" 2019)
  6. [WebDNA] IF statement evaluation bug report, WebDNA 8.5.1 (Brian Fries 2019)
2570 --Apple-Mail=_1D9C7994-F043-4DD6-8F1B-6361EB9E4347 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Shouldn=E2=80=99t matter, Scott. One expression evaluates TRUE, the = other FALSE. TRUE & FALSE =3D FALSE > On Oct 29, 2019, at 11:03 AM, Scott @ Itsula = wrote: >=20 > Evaluates strings prior to numbers? > =20 > From: Brian Fries > Sent: 29 October 2019 17:59 > To: WebDNA Talk > Subject: [WebDNA] IF statement evaluation bug report, WebDNA 8.5.1 > =20 > I=E2=80=99ve identified a bug with IF statement evaluation. My setup: >=20 > Product: WebDNA - Enterprise Edition > Version: 8.5.1 > Platform: unix-Macintosh OS X > Server OS: macOS 10.12.6 (16G2016) >=20 > Also tested on: > Product: WebDNA - Enterprise Edition > Version: 8.5.1 > Platform: unix-Macintosh OS X > Server OS: macOS 10.14.6 (18G87) >=20 > And on: > Product: WebDNA (FastCGI) > Version: 8.5.1 > Platform: linux unix 64bits > Server OS: Ubuntu 14.04.5 LTS >=20 >=20 > I can code around the bug, so I don=E2=80=99t need suggestions for = other ways to achieve my goals, I=E2=80=99m just reporting inconsistent = and incorrect behavior by WebDNA. >=20 > My code was testing for the presence of a page parameter which should = either not be present or should have a numeric value greater than zero, = depending on how the user got to the page: >=20 > [if ([pParam]>0)][then] > * Got good parameter > [/then][else] > * No parameter, or invalid parameter > [/else][/if] >=20 > This worked fine, until I added an additional expression to the IF = statement: >=20 > [text]list=3Done,two,three[/text] > [if ("[list]"^"one") & ([pParam]>0)][then] > TRUE * Got good parameter > [/then][else] > FALSE * No parameter, or invalid parameter, or list does not contain = =E2=80=9Cone" > [/else][/if] >=20 > This example ALWAYS goes to the TRUE clause, unless the first = expression fails. Whether the second expression is TRUE or FALSE = doesn=E2=80=99t matter. >=20 > For debugging, I simplified the components until I got to this, which = incorrectly executes the TRUE clause: >=20 > [if (2=3D2) & (ABC>0)][then] > TRUE > [/then][else] > FALSE > [/else][/if] >=20 > Testing the individual expressions, they both work correctly. (2=3D2) = executes the TRUE clause, while (ABC>0) executes the FALSE clause: >=20 > [if (2=3D2)][then] > TRUE > [/then][else] > FALSE > [/else][/if] >=20 > [if (ABC>0)][then] > TRUE > [/then][else] > FALSE > [/else][/if] >=20 >=20 > Interestingly, switching the order of the expressions, correctly = evaluates to the FALSE clause: >=20 > [if (ABC>0) & (2=3D2)][then] > TRUE > [/then][else] > FALSE > [/else][/if] >=20 >=20 > Thanks, > Brian Fries >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list = talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: = http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: = support@webdna.us > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list = talk@webdna.us To unsubscribe, E-mail to: = talk-leave@webdna.us archives: = http://www.webdna.us/page.dna?numero=3D55 = Bug Reporting: = support@webdna.us --Apple-Mail=_1D9C7994-F043-4DD6-8F1B-6361EB9E4347 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Shouldn=E2=80=99t matter, Scott. One expression evaluates = TRUE, the other FALSE. TRUE & FALSE =3D FALSE

On Oct = 29, 2019, at 11:03 AM, Scott @ Itsula <scott@itsula.co.uk> = wrote:

Evaluates = strings prior to numbers?
 
From: Brian Fries
Sent: 29 = October 2019 17:59
To: WebDNA Talk
Subject: [WebDNA] IF statement = evaluation bug report, WebDNA 8.5.1
 
I=E2=80=99ve identified a bug with IF statement evaluation. = My setup:

Product: WebDNA - Enterprise Edition
Version: 8.5.1
Platform: unix-Macintosh= OS X
Server OS: macOS 10.12.6 (16G2016)

Also tested on:
Product: WebDNA - Enterprise Edition
Version: 8.5.1
Platform: unix-Macintosh= OS X
Server OS: macOS 10.14.6 (18G87)

And on:
Product: WebDNA (FastCGI)
Version: 8.5.1
Platform: linux unix = 64bits
Server OS: Ubuntu 14.04.5 LTS


I can code around the bug, so I don=E2=80=99t need = suggestions for other ways to achieve my goals, I=E2=80=99m just = reporting inconsistent and incorrect behavior by WebDNA.

My code was testing for = the presence of a page parameter which should either not be present or = should have a numeric value greater than zero, depending on how the user = got to the page:

[if ([pParam]>0)][then]
* Got good parameter
[/then][else]
* No parameter, or invalid = parameter
[/else][/if]

This worked fine, until I added = an additional expression to the IF statement:

[text]list=3Done,two,three[/text]
[if ("[list]"^"one") & = ([pParam]>0)][then]
TRUE * Got good = parameter
[/then][else]
FALSE * = No parameter, or invalid parameter, or list does not = contain =E2=80=9Cone"
[/else][/if]
This example ALWAYS goes to the TRUE = clause, unless the first expression fails. Whether the second expression = is TRUE or FALSE doesn=E2=80=99t matter.

For debugging, I simplified the = components until I got to this, which incorrectly executes the TRUE = clause:

[if (2=3D2) & (ABC>0)][then]
TRUE
[/then][else]
FALSE
[/else][/if]
Testing the = individual expressions, they both work correctly. (2=3D2) executes the = TRUE clause, while (ABC>0) executes the FALSE clause:

[if (2=3D2)][then]
TRUE
[/then][else]
FALSE
[/else][/if]

[if (ABC>0)][then]
TRUE
[/then][else]
FALSE
[/else][/if]


Interestingly, switching the order of the expressions, = correctly evaluates to the FALSE clause:

[if = (ABC>0) & (2=3D2)][then]
TRUE
[/then][else]
FALSE
[/else][/if]


Thanks,
Brian Fries

--------------------------------------= ------------------- This message is sent to you because you are = subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us = archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: = support@webdna.us
--------------------------------------------------------- = This message is sent to you because you are subscribed to the mailing = list talk@webdna.us To unsubscribe, E-mail = to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us
= --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --Apple-Mail=_1D9C7994-F043-4DD6-8F1B-6361EB9E4347-- . Brian Fries

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:

WebCatalog2 Feature Feedback (1996) WebDNA Solutions ... sorry! (1997) formatting dates from a field ... (1997) Migrating to NT (1997) Frames and WebCat (1997) Forcing a NEWCART (1997) WebCatalog [FoundItems] Problem - AGAIN - (1997) Am I going senile? (Price recalc based on quantity) (1997) My new discussion forum (2003) Questions To Answer (1997) FAX orders (1996) Processing all html files through WebCat or Typhoon (1998) [WebDNA] php/mySQL version of WebDNA Speed Test? (2009) Extended [ConvertChars] (1997) Context and commands (1998) Real Audio files (1997) [WebDNA] mac osx permissions problem (2010) Who needs Yoda! (2002) OT: Verbose messages - Web*4.2 (2000) Setting up WebCatalog with Retail Pro data (1996)