[BULK] Re: [WebDNA] [if] or [case] or something else

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 110026
interpreted = N
texte = another way to deal with this is to use a table (or database) and search = function. [table name=3Dqtydiscount&fields=3Dlow,high,discount] [!] tabs have been = replaced with commas for readability, code won't work like this [/!] 1,4,.00 5,9,.02 10,19,.03 20,29,.04 30,9999,.05 [/table] [text]howmany=3D7[/text] [search = table=3Dqtydiscount&geLOWdatarq=3D[howmany]&leHIGHdatarq=3D[howmany]&max=3D= 1][founditems][discount][/founditems][/search] A tip of the hat to Grant Hulbert, who taught me this method a very very = long time ago.=20 Brian B. Burton On Dec 13, 2012, at 10:13 AM, Steve Craig wrote: > Hi All >=20 > I have a little problem that I'm hoping someone cane help with or at = least point me in the correct direction. >=20 > I have a list of prices, if the price lies in a particular range I do = one set of maths, if it lies in a different range I do a different thing = etc etc.=20 >=20 > <650 then set x to 120 > =3D>650 and < 800 set x to 110 > =3D>800 and < 950 set x to 100 > .... > .... > .... >> 1550 set x to 50 >=20 > What is the best way to code it, using if then or using switch? If = it's switch then what is the syntax of the case bit? Or maybe a = different way? >=20 > Any help much appreciated. >=20 Associated Messages, from the most recent to the oldest:

    
another way to deal with this is to use a table (or database) and search = function. [table name=3Dqtydiscount&fields=3Dlow,high,discount] [!] tabs have been = replaced with commas for readability, code won't work like this [/!] 1,4,.00 5,9,.02 10,19,.03 20,29,.04 30,9999,.05 [/table] [text]howmany=3D7[/text] [search = table=3Dqtydiscount&geLOWdatarq=3D[howmany]&leHIGHdatarq=3D[howmany]&max=3D= 1][founditems][discount][/founditems][/search] A tip of the hat to Grant Hulbert, who taught me this method a very very = long time ago.=20 Brian B. Burton On Dec 13, 2012, at 10:13 AM, Steve Craig wrote: > Hi All >=20 > I have a little problem that I'm hoping someone cane help with or at = least point me in the correct direction. >=20 > I have a list of prices, if the price lies in a particular range I do = one set of maths, if it lies in a different range I do a different thing = etc etc.=20 >=20 > <650 then set x to 120 > =3D>650 and < 800 set x to 110 > =3D>800 and < 950 set x to 100 > .... > .... > .... >> 1550 set x to 50 >=20 > What is the best way to code it, using if then or using switch? If = it's switch then what is the syntax of the case bit? Or maybe a = different way? >=20 > Any help much appreciated. >=20 "Brian B. Burton"

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:

Formulas.db not working (2006) FORMS: Returning a specific page (1997) RE: Explorer oddities (1997) Upgrade on MacOSX 3.05 to 3.08 (2000) [WebDNA] WebDNA Store (2017) Webten + Webcat running smooth (1998) Creating folders and deleting files (1997) WebCat2: Master Counter snippet (1997) Re[2]: 2nd WebCatalog2 Feature Request (1996) Db crash in win98 (2000) [WebDNA] HTML [sendmail] revisited (2009) append=T problem (1998) Cookies and webcat (1997) I think WebDNA-Talk died ... :( (1997) Mime Headers for Mail (1998) website hosters using webcat? (1999) removing programming logic white space (2003) Email (2000) Netscape v. IE (1997) Smart caching problems with 2.1b3? (1997)