CF 5 doesn't like this:
cfset nID = 3
cfset nTest1 = 2
cfset nTest2 = 3
cfswitch expression=#nID#
cfcase value=#nTest1#
brTwo
/cfcase
cfcase value=#nTest2#
brthree
/cfcase
/cfswitch
It throws an error saying the cfcase must have a
.
---
James Ang
Sr. Developer/Product Engineer
MedSeek, Inc.
[EMAIL PROTECTED]
-Original Message-
From: Shawn Grover [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 2:46 PM
To: CF-Talk
Subject: Using variables in a Switch case?
CF 5 doesn't like this:
cfset nID = 3
cfset nTest1
:46 PM
To: CF-Talk
Subject: Using variables in a Switch case?
CF 5 doesn't like this:
cfset nID = 3
cfset nTest1 = 2
cfset nTest2 = 3
cfswitch expression=#nID#
cfcase value=#nTest1#
brTwo
/cfcase
cfcase value=#nTest2#
brthree
/cfcase
in the application.cfm, AND the
page with the switch block.
Thanks anyways.
Shawn
-Original Message-
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 4:07 PM
To: CF-Talk
Subject: RE: Using variables in a Switch case?
You could do this:
-- main_template.cfm --
cfset nID
James wrote:
Uhm.. If..elseif..elseif..elseif..etc..else..endif
and
CFMX has the same problem.
And rest assured it is a problem that is not afflicted on every language. I posted a
feature request for this functionality and some others to Macromedia and it didn't get
anywhere. My impression
: Using variables in a Switch case?
James wrote:
Uhm.. If..elseif..elseif..elseif..etc..else..endif
and
CFMX has the same problem.
And rest assured it is a problem that is not afflicted on every
language. I posted a feature request for this functionality and
some others to Macromedia
]
Sent: Wednesday, March 26, 2003 3:26 PM
To: CF-Talk
Subject: RE: Using variables in a Switch case?
James wrote:
Uhm.. If..elseif..elseif..elseif..etc..else..endif
and
CFMX has the same problem.
And rest assured it is a problem that is not afflicted on every
language. I posted a feature request
, Inc.
[EMAIL PROTECTED]
-Original Message-
From: Matt Robertson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 3:26 PM
To: CF-Talk
Subject: RE: Using variables in a Switch case?
James wrote:
Uhm.. If..elseif..elseif..elseif..etc..else..endif
and
CFMX has the same problem
If you have a situation with 50 possible branchs, with 50 different
pieces of logic (imagine that flowchart! lol), hard-coding the
branches conditions would seem at least from my point of view, the
wrong way to go about it. If you already have 50, the chances are that
the conditions will change as
/Product Engineer
MedSeek, Inc.
[EMAIL PROTECTED]
-Original Message-
From: Matt Robertson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 3:26 PM
To: CF-Talk
Subject: RE: Using variables in a Switch case?
James wrote:
Uhm.. If..elseif..elseif..elseif..etc..else..endif
and
CFMX has
And of course removing the cfdump wouldn't hurt ;-)
-Original Message-
From: Matthew Walker [mailto:[EMAIL PROTECTED]
Sent: Thursday, 27 March 2003 12:01 p.m.
To: CF-Talk
Subject: RE: Using variables in a Switch case?
How about this:
cfset zipcode = 99
cf_dynamicswitch
Unfortunately the 5 territory thing was just a simplified example meant to demo the
idea. The real thing is quite a bit more complex. And the 50 thing was 50 U.S.
states. That one can be safely hardcoded in :D.
At one point in an effort to ease maintenance concerns we tried the db route, but
12 matches
Mail list logo