<div dir="ltr">Hi Boris,<div><br></div><div>Your mistake is that the first line of your placeorder function is terminated with period (.) instead of a comma (,).</div><div><br></div><div>If you make this change you should be fine.</div>
<div><br></div><div>Best regards</div><div>OJ</div><div><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 8, 2013 at 11:28 PM, Boris Barvish <span dir="ltr"><<a href="mailto:bbarvish@gmail.com" target="_blank">bbarvish@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have just started on my Erlang journey and am struggling with a compiler error that I am hoping someone with experience can spent 5 secs and tell me what i'm doing wrong, as I am not very good at understanding what the compiler is telling me. Thanks!<div>
<br></div><div>I am passing in a string such as "morning, 1, 2, 3" as the UserEntry and simply want to create a variable which holds a list of the tokens. I am getting a message from the compiler saying "syntax error before: 'case'.</div>
<div><br></div><div><pre>-module(practicum).
-export([placeorder/1]).
placeorder(UserEntry) ->
AllTokens = string:tokens(UserEntry, ",").
case hd(AllTokens) of
"morning" ->
processMorning(lists:nthtail(AllTokens,2));
"night" ->
processEvening(lists:nthtail(AllTokens,2));
_ -> io:fwrite("error\n")
end.
processMorning(Dishes) ->
Dishes.
processEvening(Dishes) ->
Dishes.</pre><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br>A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away. Antoine de Saint-Exupery<br>
</font></span></div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><br>OJ Reeves<div>+61 431 952 586<br><a href="http://buffered.io/" target="_blank">http://buffered.io/</a></div>
</div></div></div>