Re: [WebDNA] Data Type Bool
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 103228
interpreted = N
texte = --Apple-Mail-7--829851018Content-Type: text/plain;charset=US-ASCII;format=flowed;delsp=yesContent-Transfer-Encoding: 7bitOn Aug 5, 2009, at 11:37 AM, Govinda wrote:>>> > Be aware that something like [showif [instock]=1] is>>> >the same as [showif [instock]] as long as [instock] is>>> >greater than zero when an item is actually in stock. It>>> >helps make the code a little bit more readable, too.>> there was discussion back around version 4 release (year 2000?) > (IIRC) about [if] expressions taking advantage of boolean states > behind the scenes, so that one could use code like what Patrick was > referring to. In those days I did not pay enough attention about > that to say more now... but if you wanted to look into the roots of > this discussion, searching the old archives for what I am referring > to would be a good start.I happened on this from the docs on [if]..(this was what I was referring to.. in case it's useful for anyone who did not already see this before) -"Comparisons are always case-insensitive so "grant" equals "GRANT". The expression is evaluated as a mathematical boolean equation, where each sub-expression evaluates to either 0 or 1 (meaning true or false). If the entire evaluated expression is true, then the WebDNA inside the [Then] contexxt is executed, otherwise the [Else] context is executed. The [Math] context has been extended to allow for quoted text and boolean operators, and is actually what is used by [If] to perform the work of evaluating the expression. A side-effect of this allows you to use these operators inside a [math] equation: [math]1<3[/math] evaluates to "1", because the equation is true. Conversely, [math]3<1[/ math] evaluates to "0" because the equation is false. Similarly, [math]1&1[/math] evaluates to "1", and [math]1&0[/math] evaluates to "0"."--Apple-Mail-7--829851018Content-Type: text/html;charset=US-ASCIIContent-Transfer-Encoding: quoted-printable
On Aug =5, 2009, at 11:37 AM, Govinda wrote:
> Be aware that something like [showif =[instock]=3D1] is
>the same as [showif [instock]] as long as =[instock] is
>greater than zero when an item is actually in =stock. It
>helps make the code a little bit more readable, =too.
<=br>
there was discussion back around version 4 release (year =2000?) (IIRC) about [if] expressions taking advantage of boolean =states behind the scenes, so that one could use code like what Patrick =was referring to. In those days I did not pay enough attention =about that to say more now... but if you wanted to look into the =roots of this discussion, searching the old archives for what I am =referring to would be a good start.
I happened on =this from the docs on [if]..
(this was what =I was referring to.. in case it's useful for anyone who did not =already see this before) -
"
Comparisons are =always case-insensitive so "grant" equals "GRANT". The expression is =evaluated as a mathematical boolean equation, where each sub-expression =evaluates to either 0 or 1 (meaning true or false). If the entire =evaluated expression is true, then the WebDNA inside the [Then] contexxt =is executed, otherwise the [Else] context is executed. The [Math] =context has been extended to allow for quoted text and boolean =operators, and is actually what is used by [If] to perform the work of =evaluating the expression. A side-effect of this allows you to use these =operators inside a [math] equation: [math]1<3[/math] evaluates to ="1", because the equation is true. Conversely, [math]3<1[/math] =evaluates to "0" because the equation is false. Similarly, =[math]1&1[/math] evaluates to "1", and [math]1&0[/math] =evaluates to "0".
"
==--Apple-Mail-7--829851018--
Associated Messages, from the most recent to the oldest:
--Apple-Mail-7--829851018Content-Type: text/plain;charset=US-ASCII;format=flowed;delsp=yesContent-Transfer-Encoding: 7bitOn Aug 5, 2009, at 11:37 AM, Govinda wrote:>>> > Be aware that something like [showif [instock]=1] is>>> >the same as [showif [instock]] as long as [instock] is>>> >greater than zero when an item is actually in stock. It>>> >helps make the code a little bit more readable, too.>> there was discussion back around version 4 release (year 2000?) > (IIRC) about
[if] expressions taking advantage of boolean states > behind the scenes, so that one could use code like what Patrick was > referring to. In those days I did not pay enough attention about > that to say more now... but if you wanted to look into the roots of > this discussion, searching the old archives for what I am referring > to would be a good start.I happened on this from the docs on
[if]..(this was what I was referring to.. in case it's useful for anyone who did not already see this before) -"Comparisons are always case-insensitive so "grant" equals "GRANT". The expression is evaluated as a mathematical boolean equation, where each sub-expression evaluates to either 0 or 1 (meaning true or false). If the entire evaluated expression is true, then the WebDNA inside the [Then] contexxt is executed, otherwise the [Else] context is executed. The
[math] context has been extended to allow for quoted text and boolean operators, and is actually what is used by
[if] to perform the work of evaluating the expression. A side-effect of this allows you to use these operators inside a
[math] equation:
[math]1<3[/math] evaluates to "1", because the equation is true. Conversely,
[math]3<1[/ math] evaluates to "0" because the equation is false. Similarly,
[math]1&1[/math] evaluates to "1", and
[math]1&0[/math] evaluates to "0"."--Apple-Mail-7--829851018Content-Type: text/html;charset=US-ASCIIContent-Transfer-Encoding: quoted-printable
On Aug =5, 2009, at 11:37 AM, Govinda wrote:
> Be aware that something like [showif =[instock]=3D1] is
>the same as [showif [instock]] as long as =[instock] is
>greater than zero when an item is actually in =stock. It
>helps make the code a little bit more readable, =too.
<=br>
there was discussion back around version 4 release (year =2000?) (IIRC) about
[if] expressions taking advantage of boolean =states behind the scenes, so that one could use code like what Patrick =was referring to. In those days I did not pay enough attention =about that to say more now... but if you wanted to look into the =roots of this discussion, searching the old archives for what I am =referring to would be a good start.
I happened on =this from the docs on [if].. (this was what =I was referring to.. in case it's useful for anyone who did not =already see this before) -
"
Comparisons are =always case-insensitive so "grant" equals "GRANT". The expression is =evaluated as a mathematical boolean equation, where each sub-expression =evaluates to either 0 or 1 (meaning true or false). If the entire =evaluated expression is true, then the WebDNA inside the [Then] contexxt =is executed, otherwise the [Else] context is executed. The [math] =context has been extended to allow for quoted text and boolean =operators, and is actually what is used by [if] to perform the work of =evaluating the expression. A side-effect of this allows you to use these =operators inside a [math] equation: [math]1<3[/math] evaluates to ="1", because the equation is true. Conversely, [math]3<1[/math] =evaluates to "0" because the equation is false. Similarly, =[math]1&1[/math] evaluates to "1", and [math]1&0[/math] =evaluates to "0". "
==--Apple-Mail-7--829851018--
John Butler
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:
[WebDNA] v7.x [thisurl] (2010)
WebCat2b13MacPlugIn - syntax to convert date (1997)
access denied problem (1997)
WebCommerce: Folder organization ? (1997)
WebCommerce: Folder organization ? (1997)
[OT] Who's got a cool link (2002)
moved shoppingCarts folder... now there's nothing in it. (2001)
WebCat2b15MacPlugin - [protect] (1997)
WC2b12: Yes, Formulas.db is for real (1997)
Question about links (1999)
Error:Too many nested [xxx] contexts (1997)
Not really WebCat (1997)
tpl and Explorer (1998)
Frames and cart values (1998)
Configuring E-mail (1997)
where to put code (1998)
WCS Newbie question (1997)
Emailer (1997)
controlling form elements (slightly OT) (2003)
Inaugural meeting of the 'Oceanic WebDNA Programmers (2004)