<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2722" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=355332614-19122005><FONT face=Arial
size=2>Hello!</FONT></SPAN></DIV>
<DIV><SPAN class=355332614-19122005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=355332614-19122005><FONT face=Arial size=2>I'm working on
decoding a binary message. The first variables are Mandatory, so they are easy
to decode. The last of the mandatory variables is an 16 bit option mask where
each bit corresponds to an optional variable that might follow directly after
the OptionMask.</FONT></SPAN></DIV>
<DIV><SPAN class=355332614-19122005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=355332614-19122005><FONT face=Arial size=2>How can I decode
this OptionMask, and then parse the optional variables, in the cleanest
and most "Erlang optimized" way?</FONT></SPAN></DIV>
<DIV><SPAN class=355332614-19122005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=355332614-19122005><FONT face=Arial size=2><<Mandatory1,
Mandatory2, OptionMask:16/binary, Rest/binary>> =
Message,</FONT></SPAN></DIV>
<DIV><SPAN class=355332614-19122005><FONT face=Arial
size=2>etc...</FONT></SPAN></DIV>
<DIV><SPAN class=355332614-19122005><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=355332614-19122005><FONT face=Arial
size=2>/BE</FONT></SPAN></DIV><br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.</FONT></A></P>
</body></HTML>