I have a function in which I have a series of individual case statements.
case ... of
...
end,
case ... of
...
end,
...
etc.
I want to return from the function immediately when a particular case condition occurs in one of the case statements – so that the next case statement is not checked, and the function just exits/returns. How do I do that?
I would suggest you refactor to harness the full power of Erlang and its pattern matching abilities.
There isn’t a
returnoperator. Also, a little known fact is you can do something like:Return=case ... ofa
casestatement can have a “return” value.