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:
Re:Emailer and encryption (1997)
RE: WebCatalog2 for NT Beta Request (1997)
post (1997)
[SHOWNEXT] Examples (1997)
Setting up the server (1997)
WebCat2 Append problem (B14Macacgi) (1997)
WebCatalog/Mac 2.1b2 - PIXO (1997)
Another Large Database Questions (1997)
Need relative path explanation (1997)
[WebDNA] Help with work-around format date (2013)
Help! WebCat2 bug (1997)
Date Help! (2003)
Help! Missing [showif] or [hideif] (2000)
[WebDNA] Integration with QuickBooks (2011)
Most Efficiant Way to do restricted Areas (1997)
Passing form variables to new window created by JavaScript (2001)
Multi-processor Mac info ... (1997)
includes and cart numbers (1997)
[replaceChars] would be nice ... (1997)
multi-table date sort problem thingy (2002)