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:
WebDelivery downloads alias, not original ? (1997)
WebCatalog and Webstar 3.02 (1998)
Pre-flight public flag (1997)
need some help with a loop (1999)
Cart doesn't interpret tag! (1997)
webdna hideif / redirect - javascript disabled (2006)
WebCatalog 4.0 has been released! (2000)
webcatalog [date] bug...not (1999)
Where's Cart Created ? (1997)
WC2f3 (1997)
Trouble starting WC under OSX (2001)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
AOL and referrers on target=_blank (2000)
Trouble with formula.db (1997)
Re[3]: 2nd WebCatalog2 Feature Request (1996)
off topic - dna snipets (1997)
I think WebDNA-Talk died ... :( (1997)
Dummy Credit Card Number for debug? (1997)
Error Lob.db records error message not name (1997)
How to Display text in empty fields (1997)