RE: Need more coffee - help with CFIF logic please...
A case statement would be more logical... cfswitch -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: 07 October 2002 11:00 To: CF-Talk Subject: Need more coffee - help with CFIF logic please... Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
RE: Need more coffee - help with CFIF logic please...
A Case statement would be more logical : cfswitch expression=#cfformfield# cfcase value=20101-23217,23290-24658 delimiters=, DO THIS /cfcase cfcase value=27060-28909 DO THIS /cfcase cfcase value=27060-28909 DO THIS /cfcase cfcase value=23218-23298 DO ERROR MESSAGE ONE /cfcase cfdefaultcase SHOW ERROR MESSAGE TWO FOR ALL ELSE /cfdefaultcase /cfswitch -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: 07 October 2002 11:00 To: CF-Talk Subject: Need more coffee - help with CFIF logic please... Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
RE: Need more coffee - help with CFIF logic please...
This *might* work... Havnt tested it and my cases are a bit rusty... CFSWITCH EXPRESSION=#FORM.Zip# CFCASE VALUE=20101-23217,23290-24658 Do One (altho the above case may need to be split into 2 cases) /CFCASE CFCASE VALUE=27060-28909 do 2 /CFCASE CFCASE VALUE=23218-23298 error 1 /CFCASE CFDEFAULTCASE Error 2 /CFDEFAULTCASE /CFSWITCH HTH Mikey -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Monday, October 7, 2002 11:00 To: CF-Talk Subject: Need more coffee - help with CFIF logic please... Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
RE: Need more coffee - help with CFIF logic please...
the 3rd case has the wrong value, but it should work! generally a case statement is more efficient than a big IF block. For a multiple decision flow like you have, then I would more than 99% select a case over an IF. -Original Message- From: Robertson-Ravo, Neil (REC) [mailto:[EMAIL PROTECTED]] Sent: 07 October 2002 11:12 To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... A Case statement would be more logical : cfswitch expression=#cfformfield# cfcase value=20101-23217,23290-24658 delimiters=, DO THIS /cfcase cfcase value=27060-28909 DO THIS /cfcase cfcase value=27060-28909 DO THIS /cfcase cfcase value=23218-23298 DO ERROR MESSAGE ONE /cfcase cfdefaultcase SHOW ERROR MESSAGE TWO FOR ALL ELSE /cfdefaultcase /cfswitch -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: 07 October 2002 11:00 To: CF-Talk Subject: Need more coffee - help with CFIF logic please... Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
Re: Need more coffee - help with CFIF logic please...
Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? I would suggest a CFIF I don't believe that CFCASE can handle ranges only individual instances, but I could be wrong. cfif (form.zipcode GTE 20101 AND form.zipcode LTE 23217) OR (form.zipcode GTE 23290 AND form.zipcode LTE 24658 !--- Action ONE --- cfelseif form.zipcode GTE 27060 AND form.zipcode LTE 28909 !--- Action TWO --- cfelseif form.zipcode GTE 23218 AND form.zipcode LTE 23298 !--- Show Error ONE --- cfelse !--- Show Error TWO --- /cfif Hope that helps Regards Stephen (suitably coffee'd up) ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
RE: Need more coffee - help with CFIF logic please...
A Case can certainly handle ranges. -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED]] Sent: 07 October 2002 11:40 To: CF-Talk Subject: Re: Need more coffee - help with CFIF logic please... Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? I would suggest a CFIF I don't believe that CFCASE can handle ranges only individual instances, but I could be wrong. cfif (form.zipcode GTE 20101 AND form.zipcode LTE 23217) OR (form.zipcode GTE 23290 AND form.zipcode LTE 24658 !--- Action ONE --- cfelseif form.zipcode GTE 27060 AND form.zipcode LTE 28909 !--- Action TWO --- cfelseif form.zipcode GTE 23218 AND form.zipcode LTE 23298 !--- Show Error ONE --- cfelse !--- Show Error TWO --- /cfif Hope that helps Regards Stephen (suitably coffee'd up) ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
RE: Need more coffee - help with CFIF logic please...
: A Case can certainly handle ranges. This don't work though... cfcase value GT 20100 and value LT 23218 So, how would you define a range for case? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: Need more coffee - help with CFIF logic please...
With a - So for that case you would have... CFCASE VALUE=20100-23218 HTH -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Monday, October 7, 2002 13:06 To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... : A Case can certainly handle ranges. This don't work though... cfcase value GT 20100 and value LT 23218 So, how would you define a range for case? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: Need more coffee - help with CFIF logic please...
Since when does CFCASE allow a range (27060-28909) ? -Original Message- From: Mike Townend [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 6:15 AM To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... This *might* work... Havnt tested it and my cases are a bit rusty... CFSWITCH EXPRESSION=#FORM.Zip# CFCASE VALUE=20101-23217,23290-24658 Do One (altho the above case may need to be split into 2 cases) /CFCASE CFCASE VALUE=27060-28909 do 2 /CFCASE CFCASE VALUE=23218-23298 error 1 /CFCASE CFDEFAULTCASE Error 2 /CFDEFAULTCASE /CFSWITCH HTH Mikey -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Monday, October 7, 2002 11:00 To: CF-Talk Subject: Need more coffee - help with CFIF logic please... Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: Need more coffee - help with CFIF logic please...
ahhh, I though 27060-28909 was a number :-) c'mon, its Monday! -Original Message- From: Everett, Al [mailto:[EMAIL PROTECTED]] Sent: 07 October 2002 13:36 To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... Since when does CFCASE allow a range (27060-28909) ? -Original Message- From: Mike Townend [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 6:15 AM To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... This *might* work... Havnt tested it and my cases are a bit rusty... CFSWITCH EXPRESSION=#FORM.Zip# CFCASE VALUE=20101-23217,23290-24658 Do One (altho the above case may need to be split into 2 cases) /CFCASE CFCASE VALUE=27060-28909 do 2 /CFCASE CFCASE VALUE=23218-23298 error 1 /CFCASE CFDEFAULTCASE Error 2 /CFDEFAULTCASE /CFSWITCH HTH Mikey -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Monday, October 7, 2002 11:00 To: CF-Talk Subject: Need more coffee - help with CFIF logic please... Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: Need more coffee - help with CFIF logic please...
cfset x=5 cfswitch expression=#x# cfcase value=1-4 1 - 4 /cfcase cfcase value=5-8 5 - 8 /cfcase cfcase value=9-12 9 - 12 /cfcase cfdefaultcase Not found /cfdefaultcase /cfswitch Outputs Not found -Original Message- From: Everett, Al [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 8:36 AM To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... Since when does CFCASE allow a range (27060-28909) ? -Original Message- From: Mike Townend [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 6:15 AM To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... This *might* work... Havnt tested it and my cases are a bit rusty... CFSWITCH EXPRESSION=#FORM.Zip# CFCASE VALUE=20101-23217,23290-24658 Do One (altho the above case may need to be split into 2 cases) /CFCASE CFCASE VALUE=27060-28909 do 2 /CFCASE CFCASE VALUE=23218-23298 error 1 /CFCASE CFDEFAULTCASE Error 2 /CFDEFAULTCASE /CFSWITCH HTH Mikey -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Monday, October 7, 2002 11:00 To: CF-Talk Subject: Need more coffee - help with CFIF logic please... Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
RE: Need more coffee - help with CFIF logic please...
or should I say : an ID. -Original Message- From: Robertson-Ravo, Neil (REC) [mailto:[EMAIL PROTECTED]] Sent: 07 October 2002 13:40 To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... ahhh, I though 27060-28909 was a number :-) c'mon, its Monday! -Original Message- From: Everett, Al [mailto:[EMAIL PROTECTED]] Sent: 07 October 2002 13:36 To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... Since when does CFCASE allow a range (27060-28909) ? -Original Message- From: Mike Townend [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 6:15 AM To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... This *might* work... Havnt tested it and my cases are a bit rusty... CFSWITCH EXPRESSION=#FORM.Zip# CFCASE VALUE=20101-23217,23290-24658 Do One (altho the above case may need to be split into 2 cases) /CFCASE CFCASE VALUE=27060-28909 do 2 /CFCASE CFCASE VALUE=23218-23298 error 1 /CFCASE CFDEFAULTCASE Error 2 /CFDEFAULTCASE /CFSWITCH HTH Mikey -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Monday, October 7, 2002 11:00 To: CF-Talk Subject: Need more coffee - help with CFIF logic please... Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
Re: Need more coffee - help with CFIF logic please...
So I was right after all! Thought that I was going loopy or something!!! Stephen (who thought he'd had a enough coffee when he wrote his reply) - Original Message - From: Robertson-Ravo, Neil (REC) [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Monday, October 07, 2002 1:39 PM Subject: RE: Need more coffee - help with CFIF logic please... ahhh, I though 27060-28909 was a number :-) c'mon, its Monday! -Original Message- From: Everett, Al [mailto:[EMAIL PROTECTED]] Sent: 07 October 2002 13:36 To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... Since when does CFCASE allow a range (27060-28909) ? -Original Message- From: Mike Townend [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 6:15 AM To: CF-Talk Subject: RE: Need more coffee - help with CFIF logic please... This *might* work... Havnt tested it and my cases are a bit rusty... CFSWITCH EXPRESSION=#FORM.Zip# CFCASE VALUE=20101-23217,23290-24658 Do One (altho the above case may need to be split into 2 cases) /CFCASE CFCASE VALUE=27060-28909 do 2 /CFCASE CFCASE VALUE=23218-23298 error 1 /CFCASE CFDEFAULTCASE Error 2 /CFDEFAULTCASE /CFSWITCH HTH Mikey -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Monday, October 7, 2002 11:00 To: CF-Talk Subject: Need more coffee - help with CFIF logic please... Trying to evaluate and assign various stuff depending on a zip code coming from a cfform field. Basically: If the zipcode is 20101-23217 or 23290-24658 do thing ONE If the zipcode is 27060-28909 do thing TWO If the zipcode is 23218-23298 show error message ONE All other Zip Codes, show error message TWO Suggestions as to the best way to construct this? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com