I said:
> The following cfif has been working fine in CF5 for 3 years
> but it breaks in
> MX 6.1 with updater (we are just now migrating CF5 to MX, so
> I don't know if
> it would have worked in MX or MX 6.1 pre updater . . .):
>
> ****
> <cfif right(trim(code), 1) is not 0
> and trim(code) is not "W8"
> and trim(code) is not "W12"
> and right(trim(code), 3) is not 904
> or not isDefined("RS1")>
>
> closeTransferWindow();
> alert("An error has occured within this application,
> please try again later.
> <cfoutput>#code#-#message#</cfoutput>");
> <cfelse>
> ****
Bud said:
> It looks to me like there is a parentheses missing or something,
> depending on what RS1 is.
Rebecca said:
> Exactly. The way this is written, the cfif statement could
> still execute even is the code = "W8" or "W12" if RS1 is not defined.
Dave asked:
> You have an OR at the end. Which is the intended outcome?
>
> if (a and b and c and d) or e
>
> or
>
> if a and b and c and (d or e)
>
> Also, doesn't the Right() function return a substring, not a
> number? Or are
> you looking to see whether that substring is "0"?
The intended logic is
if (a and b and c and d) or e
and we are looking to see if the Right() substring is "0" . . .
We have played with parens and it made no difference. However, as Rebecca
suggested, we have discovered that in our situation where this problem
surfaces, on CFMX RS1 IS NOT defined and on CF5 RS1 IS defined.
RS1 is a one line result set returned by the stored procedure that most of
the time contains a date and some other data that we do not use or on
occasions like our problem situation it is 'empty' (nulls?).
In any case, after a hard look at the code we don't see any reason for the
'or not isDefined("RS1")' to be in the cfif statement so we have removed it
and everything appears to be working fine now . . .
Thanks, all, for your responses . . .
George
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192750
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54