[erlang-questions] dets:info/2
Tim
erlang@REDACTED
Sun Jun 30 19:50:55 CEST 2013
Ooookaaaay. I see I'm going to have to unlearn a lot of assumptions to get my brain into the Erlang groove. :)
Thanks for sorting that out - it does now work as expected.
One parting question though: If integers and strings (lists of integers) are _not_ interchangeable, why doesn't this line generate an error?
{html, MyInfo}.
On 01/07/2013, at 1:21 AM, Joseph Wayne Norton <norton@REDACTED> wrote:
> MyInfo is an integer. You need to convert it to a string before using the "++" operator. A string is simply a list of integers in Erlang.
...
> 1> dets:open_file(ingredients, [{file,"ingredients.dets"},{type,set}]).
> {ok,ingredients}
> 2>
> 2> MyInfo = dets:info(ingredients,no_objects).
> 0
> 3> integer_to_list(MyInfo).
> "0"
More information about the erlang-questions
mailing list