"YES" and true
It sounds like MX - with stronger variable typing - is resoving the "Y" and
"YES" strings and the keyword "true" to the value "1.0"
Try resolving the differences in "target" before using it in the SWITCH
statement. The YesNoFormat() function does this nicely for you, then just
check for "YES" or "NO" This function is backward compatible too.
Jevo
-----Original Message-----
From: Patricia G. L. Hall [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2003 8:29 AM
To: CF-Talk
Subject: Switch:Case Differs in CFMX from CF5?
... generic example trimmed ...
I have run this syntax in CF5 successfully. Just now I tried the same on
a box with CFMX 6.1 and I get this error:
Context validation error for tag CFCASE.
The CFSWITCH has a duplicate CFCASE for value "1.0".
FYI, here is the specifc code I was running:
function convertBooleanOrNull(target) {
var value = "NULL";
switch (target) {
case "Y":
case "Yes":
case true:
value = True;
break;
case "N":
case "No":
case false:
value = False;
break;
}
return value;
}
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

