case search_term
when 'a'
ptr = 0
when 'b'
ptr = 1
when 'c'
ptr = 2
else
ptr = 99
end
if location = 'xyz' and search_term = 'c'
ptr = 0
end
Is there any way to include the if above in the case statement?
ptr = case search_term
when 'a'
0
when 'b'
1
when 'c'
if location == 'xyz' then #note the ==
0
else
2
end
else
99
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With