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 a number. It will return the first number it sees, without performing whatever equation you've set up. if [sku]=111abc222def then [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:

    
  1. Re: showif field is number (Kenneth Grome 1997)
  2. Re: showif field is number (Pat McCormick 1997)
  3. showif field is number (Pat McCormick 1997)
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 a number. It will return the first number it sees, without performing whatever equation you've set up. if [sku]=111abc222def then [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:

Highlighting words found in a keyword search (2003) [WebDNA] WebDNA on a cPanel server? Maybe not ... (2019) WebCatalog 402rc2 is now available (2001) [WebDNA] Bug in 6.2? (2009) (no subject) (1997) All choices on IE different than Netscape (1997) Strange WebDNA server not running error (2006) off topic - dna snipets (1997) Search Engine questions ... (2002) Problem with [CART] number (1998) Fun with dates (1997) Showing specific [cart] contents (1998) [BULK] [WebDNA] [BULK] WebDNA 7 - Ready or Not ?? I'm not sure... (2011) [IpAddress] Tag (1997) Nested search (1997) OT: 800x600 (2003) WebCat2b13MacPlugin - nested [xxx] contexts (1997) Web Delivery First Time Setup Trouble (2000) Using Plug-In while running 1.6.1 (1997) URL for Discussion Archive (1997)