You can use cfscript to have a bit more flexibility with switch statements.
The difference here is that you can eliminate "break;" statements to lump
case values together. Like this:
<cfscript>
nValue = 3;
switch(nValue)
{
case "2":
case "4":
case "6":
case "8":{
WriteOutput("Even.");
bEven = true;
break;
}
case "1":
case "3":
case "5":
case "7":
case "9":
{
WriteOutput("Odd.");
bEven = false;
break;
}
}
</cfscript>
---
Paul Mone
Ninthlink Consulting Group
[EMAIL PROTECTED]
619.222.7082
-----Original Message-----
From: Gregory Harris [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 14, 2000 3:02 PM
To: CF-Talk
Subject: CFCASE Help?
This is a multi-part message in MIME format.
------=_NextPart_000_0196_01C04E4B.D4F95E40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Can you use <CFCASE> to evaluate numeric expressions such as a between =
statement, or greater than/less than statements? Specifically this is =
the following statement:
<CFCASE VALUE=3D"BETWEEN 6 AND 9">
Cold Fusion evaluates this literally instead of mathematically, any =
ideas for help? Thanks!
Gregory Harris
Web Developer
Stirling Bridge Group LLC
------=_NextPart_000_0196_01C04E4B.D4F95E40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Can you use <CFCASE> to evaluate =
numeric=20
expressions such as a between statement, or greater than/less than=20
statements? Specifically this is the following =
statement:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><CFCASE VALUE=3D"BETWEEN 6 AND =
9"></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Cold Fusion evaluates this literally =
instead of=20
mathematically, any ideas for help? Thanks!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Gregory Harris<BR>Web =
Developer<BR>Stirling Bridge=20
Group LLC<BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_0196_01C04E4B.D4F95E40--
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]