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

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 110030
interpreted = N
texte = Should it not be .... [text]howmany=7[/text] [search table=qtydiscount&leLOWdatarq=[howmany]&geHIGHdatarq=[howmany]&max=1][foundi tems][discount][/founditems][/search] The "le" and "ge" switch places so that with the value 7, it targets the correct row of 5,9,.02 Cheers TDn -----Original Message----- From: Brian B. Burton [mailto:brian@burtons.com] Sent: Friday, December 14, 2012 01:42 To: talk@webdna.us Subject: [BULK] Re: [WebDNA] [if] or [case] or something else Importance: Low another way to deal with this is to use a table (or database) and search function. [table name=qtydiscount&fields=low,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=7[/text] [search table=qtydiscount&geLOWdatarq=[howmany]&leHIGHdatarq=[howmany]&max=1][foundi tems][discount][/founditems][/search] A tip of the hat to Grant Hulbert, who taught me this method a very very long time ago. Brian B. Burton On Dec 13, 2012, at 10:13 AM, Steve Craig wrote: > Hi All > > I have a little problem that I'm hoping someone cane help with or at least point me in the correct direction. > > 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. > > <650 then set x to 120 > =>650 and < 800 set x to 110 > =>800 and < 950 set x to 100 > .... > .... > .... >> 1550 set x to 50 > > 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? > > Any help much appreciated. > --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us Associated Messages, from the most recent to the oldest:

    
Should it not be .... [text]howmany=7[/text] [search table=qtydiscount&leLOWdatarq=[howmany]&geHIGHdatarq=[howmany]&max=1][foundi tems][discount][/founditems][/search] The "le" and "ge" switch places so that with the value 7, it targets the correct row of 5,9,.02 Cheers TDn -----Original Message----- From: Brian B. Burton [mailto:brian@burtons.com] Sent: Friday, December 14, 2012 01:42 To: talk@webdna.us Subject: [BULK] Re: [WebDNA] [if] or [case] or something else Importance: Low another way to deal with this is to use a table (or database) and search function. [table name=qtydiscount&fields=low,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=7[/text] [search table=qtydiscount&geLOWdatarq=[howmany]&leHIGHdatarq=[howmany]&max=1][foundi tems][discount][/founditems][/search] A tip of the hat to Grant Hulbert, who taught me this method a very very long time ago. Brian B. Burton On Dec 13, 2012, at 10:13 AM, Steve Craig wrote: > Hi All > > I have a little problem that I'm hoping someone cane help with or at least point me in the correct direction. > > 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. > > <650 then set x to 120 > =>650 and < 800 set x to 110 > =>800 and < 950 set x to 100 > .... > .... > .... >> 1550 set x to 50 > > 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? > > Any help much appreciated. > --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us "Terry Nair"

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:

Still Stumped on ShowNext...HELP! (1997) Word search (1997) Bug Report, maybe (1997) question: webdelivery folder and file (1997) SiteGuard Admin Feature ? (1997) WebStar5 and realm authentication (2003) Nested tags count question (1997) SiteEdit NewFile.html ? (1997) WebDNA & Apache 1.3.27 (2003) Browser Info.txt (1997) Using Plug-In while running 1.6.1 (1997) Strange intermittent WebDNA problems (2008) Re:quit command on NT (1997) sendmail and CGatePro - Not working (2003) [thisurl] (2004) emailer (1998) Re2: frames & carts (1997) Encrypt/Decrypt (2007) Help name our technology! (1997) Emailer problems addition (1999)