Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Am I missing something basic? (why won't this exp work?)

Avatar

Former Community Member
What am I over-looking?



if ( rt1A == 99 and rt1B == 1 ) then

rt1A

elseif ( rt1A == 99 and rt1B == 2) then

rt1A-20

elseif (rt1A == 99 and rt1B == 3 or 4) then ***********

777

elseif ( rt1A == 159 and rt1B == 1 ) then

159

elseif ( rt1A == 159 and rt1B == 2 ) then

888



else

222

endif



I have a pull-down marked rt1A and another marked rt1B

rt1A can be assigned either 99 or 159

rt1B can be assigned either 1 2 3 or 4



I set the rt1A to default to 159, but it always ends up on the marked line (***********)

rt1A ISN'T 99 and rt1B ISN'T 3 or 4. Why does it stop on that line?
1 Reply

Avatar

Level 7
>elseif (rt1A == 99 and rt1B == 3 or 4) then



This is the same as writing



elseif (

(

(t1A == 99 ) and ( rt1B == 3 )

)

or

4

)



The value 4 is the same as true, and anything or true is true, so this

isn't what you want. You aren't testing for rt1B == 4 at all. If you

want to compare with either of two values, write



elseif ( t1A == 99 and ( rt1B == 3 or rt1B == 4 ) )



Aandi Inston