Re: showif field is number
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 15662
interpreted = N
texte = Kenneth Grome wrote:> > >Is their a quick way to do [showif [field] is a number] ?> >> >Will this work? [showif [math][field]+1[/math]!] In other words, if the> >field is non-numeric, the math context will return a blank.> > I think something like this will work, but I don't remember what's> returned, whether it's blank or zero or some unpredictable number.> You'll probably have to play around with this technique to see what> you get ... :)It turns out that WC will return a value for any field *starting* with anumber. It will return the first number it sees, without performing whateverequation you've set up. if [sku]=111abc222defthen [math][sku]+1[/math] will return 111It only increments if it is a pure number.I ended up doing a comparison of the results to determine if it incremented.Pat
Associated Messages, from the most recent to the oldest:
Kenneth Grome wrote:> > >Is their a quick way to do [showif [field] is a number] ?> >> >Will this work? [showif
[math][field]+1[/math]!] In other words, if the> >field is non-numeric, the math context will return a blank.> > I think something like this will work, but I don't remember what's> returned, whether it's blank or zero or some unpredictable number.> You'll probably have to play around with this technique to see what> you get ... :)It turns out that WC will return a value for any field *starting* with anumber. It will return the first number it sees, without performing whateverequation you've set up. if [sku]=111abc222defthen
[math][sku]+1[/math] will return 111It only increments if it is a pure number.I ended up doing a comparison of the results to determine if it incremented.Pat
Pat McCormick
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] Client wants backup copy of site (2010)
Cobalt RaQ (2000)
Trouble with formula.db + more explanation (1997)
Frames and WebCat (1997)
Apache 2.x (2003)
Many $WebCat.exe processes (1998)
WebDNA 5.1 is now available! (2003)
How do I handle extra spaces? (2002)
Problems with [Search] param - Mac Plugin b15 (1997)
Webcatalog-firesite and [referrer] tag (1997)
pop up menu's (1998)
Macauth: Dates and No Scripting... (1997)
system crashes, event log (1997)
For Sale: WebTen 2.x and WebCat 2.x (2000)
Text limits in NT version? (1997)
Adding up weights (1998)
Logging purchases (1997)
[append] problems (2003)
PC Auth Hub+Merchant (1998)
cookies crumbling (1999)