<div dir="ltr"><div>I offer this approach:</div><div><br></div><div>{ok, Result} = eldap:search(S, Search),</div><div>eldap:close(S),</div><div>{eldap_search_result, [{_, _, [{"status", [Status]}]}], []} = Result,</div>
<div><br></div><div>& at this point, Status =:= "available", if I have successfully balanced the brackets and braces. You may wish also to match 'eldap_entry' in your assignment.</div><div><br></div>
<div>Regards,</div><div>John R. Ashmun<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jan 12, 2014 at 11:41 AM, Thomas Elsgaard <span dir="ltr"><<a href="mailto:thomas.elsgaard@gmail.com" target="_blank">thomas.elsgaard@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div>Hi list</div><div> </div><div>I am experimenting with eldap, but i am wondering on how to correctly get the result from an ldap search?</div>
<div> </div><div>In my module, i am doing an eldap:search</div>
<div> </div><div>-----------------</div><div>{ok, Result} = eldap:search(S, Search),</div><div>eldap:close(S),</div><div>io:format("Search Result: ~p~n", [Result]).<br>-----------------</div><div> </div><div>And i am getting following:</div>
<div> </div><div>-----------------</div><div>Search Result: {eldap_search_result,<br> [{eldap_entry,<br> "blaa,blaaa,blaa,blaa,blaa",<br> [{"status",["available"]}]}],<br>
[]}<br>ok</div><div>-----------------</div><div> </div><div>So far so good, eldap is doing it's work, but what i am really interrested in is just the content of the attribute status which is "available". How can i get the status into an variable? Do i need to get it from an record, or ?</div>
<span class="HOEnZb"><font color="#888888">
<div> </div><div>Thomas </div><div> </div></font></span></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div></div>