RE: switch in CFSCRIPT
This should do what you are looking for: cfscript switch (iAnsType){ case 6 : case 7 : sAnswer = Replace(sAnswer, ,, |, ALL); } /cfscript -Original Message- From: CF Dude [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:39 PM To: CF-Talk Subject: switch in CFSCRIPT Is there a way to do multiple values per case statement when doing a switch inside of a cfscript tag? cfscript switch (iAnsType){ case 6 : sAnswer = Replace(sAnswer, ,, |, ALL); case 7 : sAnswer = Replace(sAnswer, ,, |, ALL); } /cfscript EG, I was hoping to do this cfscript switch (iAnsType){ case 6, 7 : sAnswer = Replace(sAnswer, ,, |, ALL); } /cfscript Eric ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 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 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: switch in CFSCRIPT
I think you just use something like below, syntax might be a little(or alot) wrong though cfscript switch (iAnsType) { case 6: case 7: sAnswer = Replace.; } /cfscript Ade -Original Message- From: CF Dude [mailto:[EMAIL PROTECTED] Sent: 05 June 2003 17:39 To: CF-Talk Subject: switch in CFSCRIPT Is there a way to do multiple values per case statement when doing a switch inside of a cfscript tag? cfscript switch (iAnsType){ case 6 : sAnswer = Replace(sAnswer, ,, |, ALL); case 7 : sAnswer = Replace(sAnswer, ,, |, ALL); } /cfscript EG, I was hoping to do this cfscript switch (iAnsType){ case 6, 7 : sAnswer = Replace(sAnswer, ,, |, ALL); } /cfscript Eric ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 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 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: switch in CFSCRIPT
Also, don't forget to put a break; after your code in the case So, it should be; cfscript switch (iAnsType){ case 6 : case 7 : {sAnswer = Replace(sAnswer, ,, |, ALL); break; } } /cfscript Is there a way to do multiple values per case statement when doing a switch inside of a cfscript tag? cfscript switch (iAnsType){ case 6 : sAnswer = Replace(sAnswer, ,, |, ALL); case 7 : sAnswer = Replace(sAnswer, ,, |, ALL); } /cfscript EG, I was hoping to do this cfscript switch (iAnsType){ case 6, 7 : sAnswer = Replace(sAnswer, ,, |, ALL); } /cfscript ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 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 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: switch in CFSCRIPT
Thanks. - Original Message - From: Philip Arnold [EMAIL PROTECTED] Also, don't forget to put a break; after your code in the case So, it should be; cfscript switch (iAnsType){ case 6 : case 7 : {sAnswer = Replace(sAnswer, ,, |, ALL); break; } } /cfscript Is there a way to do multiple values per case statement when doing a switch inside of a cfscript tag? cfscript switch (iAnsType){ case 6 : sAnswer = Replace(sAnswer, ,, |, ALL); case 7 : sAnswer = Replace(sAnswer, ,, |, ALL); } /cfscript EG, I was hoping to do this cfscript switch (iAnsType){ case 6, 7 : sAnswer = Replace(sAnswer, ,, |, ALL); } /cfscript ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Host with the leader in ColdFusion hosting. Voted #1 ColdFusion host by CF Developers. Offering shared and dedicated hosting options. www.cfxhosting.com/default.cfm?redirect=10481 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4