If you examine my code, you see I changed the code to set result. In any case, it can't do EXACTLY what the switch did, because the switch did nothing. I suppose you can do it with if's too (if that is what he wants to do) and probably the code will even be better then.
-----Original Message-----
From: Philip Arnold [mailto:[EMAIL PROTECTED]
Sent: maandag 17 november 2003 14:40
To: CF-Talk
Subject: RE: Very vague error message

But, without the "break;" in the case, this doesn't do the same thing

If you want to do EXACTLY what the switch did, then you don't want the
"else if", but just "if"

-----Original Message-----
From: Pascal Peters [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 7:20 AM
To: CF-Talk
Subject: RE: Very vague error message

if(type IS request.AUTH_ACL){
result = u_access[j][key] OR u_access[j]['auth_mod'] OR is_admin;
}
else if(type IS request.AUTH_MOD){
result = result OR u_access[j]['auth_mod'] OR is_admin;
}
else if(type IS request.AUTH_ADMIN){
result = result OR is_admin;
}
-----Original Message-----
From: Ryan Mitchell [mailto:[EMAIL PROTECTED]
Sent: maandag 17 november 2003 13:07
To: CF-Talk
Subject: Re: Very vague error message

Ok, tracked it down to the switch statement:

            switch(type)
            {
                case request.AUTH_ACL:
                    result = u_access[j][key];

                case request.AUTH_MOD:
                    result = result OR u_access[j]['auth_mod'];

                case request.AUTH_ADMIN:
                    result = result OR is_admin;
                    break;
            }

On reading the cf reference I see that in a switch statement:
³Each constant value must be a constant (that is, not a variable, a
function, or other _expression_).²

As you can see each of my case¹s is a variable which is the problem...
Is
there any way of using the variable but not getting the error?

  _____  

  _____  


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to