<div dir="ltr">The crash is because the message doesn't look like I assumed. I didn't pay attention and didn't see that it should be {{X, Y, Z}} = Coordinates (two levels of braces)<div><br></div><div>To get rid of the warning, you can rewrite </div><div><br></div><div><span style="font-size:12.8px">loop(Orbiter1) -></span><br style="font-size:12.8px"><span style="font-size:12.8px"> receive</span><br style="font-size:12.8px"><span style="font-size:12.8px"> {Orbiter1, Coordinates={{X,Y,Z}}} -> </span><br style="font-size:12.8px"><span style="font-size:12.8px"> io:format("Coordinates: ~p~n", [Coordinates]),</span><br style="font-size:12.8px"><span style="font-size:12.8px"> io:format("X: ~p, Y: ~p, Z: ~p~n", [X, Y, Z])</span><br style="font-size:12.8px"><span style="font-size:12.8px"> end,</span><br style="font-size:12.8px"><span style="font-size:12.8px"><span style="font-size:12.8px"> loop(Orbiter1).</span><br style="font-size:12.8px"></span></div><div><span style="font-size:12.8px"><span style="font-size:12.8px"><br></span></span></div><div><span style="font-size:12.8px"><span style="font-size:12.8px">For a real server, you probably want to handle more messages, and ignore those you don't care about. For example</span></span></div><div><span style="font-size:12.8px"><span style="font-size:12.8px"><br></span></span></div><div><span style="font-size:12.8px">loop(Orbiter1) -></span><br style="font-size:12.8px"><span style="font-size:12.8px"> receive</span><br style="font-size:12.8px"><span style="font-size:12.8px"> {Orbiter1, Coordinates={{X,Y,Z}}} -> </span><br style="font-size:12.8px"><span style="font-size:12.8px"> io:format("Coordinates: ~p~n", [Coordinates]),</span><br style="font-size:12.8px"><span style="font-size:12.8px"> io:format("X: ~p, Y: ~p, Z: ~p~n", [X, Y, Z]),</span></div><div><div><span style="font-size:12.8px"><span style="font-size:12.8px"> loop(Orbiter1);</span><br style="font-size:12.8px"></span></div><div><span style="font-size:12.8px"><span style="font-size:12.8px"> _ -></span></span></div><div> ok % stop if unknown message arrives</div><span style="font-size:12.8px"> end.</span><br style="font-size:12.8px"></div><div><span style="font-size:12.8px"><br></span></div><div>regards,<br></div><div>Vlad</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 29, 2016 at 4:52 PM, Donald Steven <span dir="ltr"><<a href="mailto:t6sn7gt@aim.com" target="_blank">t6sn7gt@aim.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Alas that produces:</p>
<p><span style="font-size:12.8px">problem.erl:26: Warning: variable
'Coordinates' exported from 'receive' (line 26)<br>
{"init terminating in
do_boot",{{badmatch,{{-4.99800<wbr>0e+02,6.000000e-01,2.000000e-<wbr>01}}},[{problem,loop,1,[{file,<wbr>"problem.erl"},{line,29}]},{<wbr>init,start_em,1,[]},{init,do_<wbr>boot,3,[]}]}}<span><br>
init terminating in do_boot ()<br>
</span></span><span style="font-size:12.8px"></span></p><span>
<br>
<div>On 09/29/2016 10:34 AM, Vlad Dumitrescu
wrote:<br>
</div>
<blockquote type="cite"><span style="font-size:12.8px">loop(Orbiter1) -></span><br style="font-size:12.8px">
<span style="font-size:12.8px"> Coordinates = receive</span><br style="font-size:12.8px">
<span style="font-size:12.8px"> {Orbiter1, Coordinates}
-> </span><span style="font-size:12.8px">Coordinates</span><br style="font-size:12.8px">
<span style="font-size:12.8px"> end,</span><br style="font-size:12.8px">
<span style="font-size:12.8px"> {X, Y, Z} = Coordinates,</span><br style="font-size:12.8px">
<span style="font-size:12.8px"> io:format("Coordinates: ~p~n",
[Coordinates]),</span><br style="font-size:12.8px">
<span style="font-size:12.8px"> io:format("X: ~p, Y: ~p, Z:
~p~n", [X, Y, Z])</span><br style="font-size:12.8px">
<span style="font-size:12.8px"> loop(Orbiter1).</span></blockquote>
<br>
</span></div>
</blockquote></div><br></div></div>