This works fine and I'll get back, for example <<"%">>, which
is_binary tells me is a binary. I've tried
binary_to_integer(<<"%">>) but I get a badarg error.
This does what you want, but there may be
better ways (I'm an Erlang newbie, too):
<<Integer>> = Binary, Integer.
I'm sorry I don't understand. Let's say I have a value of <<"%">>,
and assign it to B. Let's say:
B = <<"%">>,
If I want to assign the value of "%" (decimal 37) to integer I, how do
I complete the expression:
such that I will equal 37.
Strictly speaking, I don't know. :-)
That said, Erlang's "=" operator isn't as assignment operator,
pattern matching operator that binds its operands in the case of a
match. So the following function reads one character from the file
named by the given name, and returns the integer value of that
I think if you understand how/why the first line binds Fd to the
descriptor, and how the second line binds B to the binary read
file , then you'll also be able to make sense of the third line
binds I to the integer value of B.
Please direct further inquiries to the list rather than to me
and feel free to forward this entire reply to the list for further