[erlang-questions] Traverse dets and get all items

Bernard Duggan <>
Sat Jan 15 03:39:13 CET 2011


Or, if you wanted to be more circuitous, you could drop the dets table 
into an ets table with dets:to_ets/2, then use ets:tab2list/1.  But on 
balance dets:foldl/3 is probably "righter" :)

B

On 14/01/2011 10:17 PM, Bengt Kleberg wrote:
> Greetings,
>
> To accumulate things you could use dets:foldl/3
>
>
> bengt
>
> On Fri, 2011-01-14 at 11:58 +0100, shk wrote:
>> Hello,
>>
>> I have dets table. Table view:
>>
>> {Time, Date, Space, Text}
>>
>> I need travers this table and put all data to list or another data
>> structure. I find example:
>>
>> Fun = fun(X) ->  io:format("~p~n", [X]), continue end,
>> dets:traverse(MyTable,Fun).
>>
>> But it's only print dets items in console. How can i get all dets items and
>> put it into list or something else?
>>
>> Thank you.
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>



More information about the erlang-questions mailing list