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:
Running WebCat on a Virtual Server (2008)
linetiems in thankyou.tpl (1997)
[WebDNA] Issue with including functions (2011)
Did you hear about this? (1997)
WebCat for Unix?? (1997)
2.0Beta Command Ref (can't find this instruction) (1997)
Two submit buttons ? (1997)
Loss in Form (1998)
Pre-flight public flag (1997)
WebCat for Unix?? (1997)
Date in IF ELSE Comparison (2004)
A *secret* new webdna tag !!! (1999)
Don't tick me off :) [elaspedtime] (1997)
Sorting error (1997)
Date problems (1997)
search w/international chars (1999)
Is this possible, WebCat2.0 and checkboxes (1997)
trouble with [shownext] (2000)
database size? (1997)
Web Catalog 2 demo (1997)