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:
What am I missing (1997)
Snake Bites (1997)
Shopping Cart ID (1998)
Bug Report, maybe (1997)
autocommit problem (1998)
Username for Admin Group (1997)
Shell Script needed (2003)
[lookup] speed sales pitch (2003)
[WebDNA] WebDNA Crashing or Not **YES** (2008)
Protecting Images (2003)
WebCat2b13MacPlugIn - syntax to convert date (1997)
[convertchars] HELP!!! (1999)
WebCatalog seems to choke on large (2meg) html files. (1998)
Automatic Download? (2003)
Online reference (1997)
[WebDNA] COMMITDATABASE in linux unix 64bits FastCGI version 8.6 (2020)
Hairy Shipping Monster (2006)
NT b19 sends extra MIME headers (1997)
Targeted Redirect (1999)
Cancel Subscription (1996)