it, but I believe the reason behind the error is that in MX "Yes" and
"True" are the same. I wouldn't expect CFMX to go so far as to accept
"Y" as the same as the other two.
It's not really a big deal. The only thing for me to consider if it
were is to what degree do I want the function to be compatible with
both 5 and MX. My first thoughts is that in order to have the function
be compatible I will need to not use cfswitch only because I'd have to
do some backbends to make it work with MX's strict validation and 5's
not so strict validation. While writing the same function with
if/else combos isn't as sexy or neat it would do the trick on both
versions.
Either way it's nothing I couldn't figure out with a little time and
testing.
As it is, I don't really have to worry about that now. It's enough for
me to know the reason why I received the error message on one platform
but not on another.
-Patti
On Thursday, October 23, 2003, at 07:54 PM, J E VanOver wrote:
> But can't you just add the YesNoValue function to your switch?
>
> like this:
>
> switch (yesnovalue(target)) {
> ���case "Yes":
> ������value = True;
> ������break;
> ���case "No":
> ������value = False;
> ������break;
> }
>
> -----Original Message-----
> From: Patricia G.L.Hall [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 23, 2003 12:33 PM
> To: CF-Talk
> Subject: Re: Switch:Case Differs in CFMX from CF5?
>
> That sounds about right.��I'll test, but I'm pretty sure it is the
> case.
>
> As to your suggested resolution:��I'll have to rewrite the script to
> use if/else since the point of the udf IS to resolve the differences of
> "target".��I have to work with existing data and sometimes I'll get Y,
> yes 1, etc... so I wanted this function to do that work for me.��Ah
> well.��If/Else it is.
>
> -Patti
>
> On Wednesday, October 22, 2003, at 05:08��PM, J E VanOver wrote:
>
> > I would guess then that it is the SPECIFIC values you are using --
> "Y",
> > "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;
> > }
> >
> >
> <image.tiff>
> >
> >
>
<image.tiff>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

