Legal binary syntax?

Vladimir Sekissov svg@REDACTED
Mon Dec 30 18:00:21 CET 2002


Good day,

The two occurrences of Len are not allowed.
You must rewrite code your code as:

<<Len:16/unsigned, Rest/binary>> = Bytes,
<<Id1:16/unsigned, Id2:16/unsigned, Pdu:Len/binary>> = Rest,
...

Best Regards,
Vladimir Sekissov

erlang> Is this a legal binary syntax:
erlang> 
erlang> <<Len:16/unsigned, Id1:16/unsigned, Id2:16/unsigned, Pdu:Len/binary>> = Bytes,
erlang> where Bytes is a binary.
erlang> 
erlang> I received "Len unbound" error message.
erlang> If assignment is left to right why does this happen ?
erlang> 
erlang> 
erlang> Thanks,
erlang> Eduardo Figoli
erlang> INSwitch Solutions
erlang> 
erlang> 



More information about the erlang-questions mailing list