Sunday, May 4, 2014

Simple IF function in Erlang

-module(simple_if).
-export([login/2]).

login(UserName,Pwd) ->
    if
        UserName==udara , Pwd==123 ->
            "Authenticated";

        UserName==udara , Pwd /= 123 ->
            "Password Error";

        UserName /= udara , Pwd ==123 ->
            "User Name Error";

        true ->
            "Authentication failed"
    end.

Labels: , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home