I have 2 define:
-define(LOGIN_PACKET, 1).
-define(LOGOUT_PACKET, 2).
An try to:
case func(...) of
LOGIN_PACKET ->
.....;
LOGOUT_PACKET ->
......
end
But i get warning:
this clause cannot match because a previous clause at line 209 always matches.
Why? Can we use defines in case of in Erlang.
Thank you.
Do it like below
case func(...) of ?LOGIN_PACKET -> .....; ?LOGOUT_PACKET -> ...... end