<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16825" name=GENERATOR></HEAD>
<BODY>
<DIV>Hi all,</DIV>
<DIV> </DIV>
<DIV>I want, from a supervisor, to start two childs having the same code 
(the same gen_server, called here generic), with two parameters.</DIV>
<DIV>Does this syntax correct ?</DIV>
<DIV>- the first parameter is one number</DIV>
<DIV>- the second parameter is one function.</DIV>
<DIV> </DIV>
<DIV>init()-></DIV>
<DIV>Spec1= {id1, generic, start_link, [par1_1,par2_1],permanent, 
brutal_kill,worker, [generic]},</DIV>
<DIV>Spec2= {id2, generic, start_link, [par1_2,par2_2],permanent, 
brutal_kill,worker, [generic]},</DIV>
<DIV>Childs= [Spec1,Spec2],</DIV>
<DIV>case supervisor:check_childspecs(Childs) of</DIV>
<DIV>{ok} -></DIV>
<DIV>    SChilds={{one_for_one,2,10},Childs),</DIV>
<DIV>    {ok,SChilds};</DIV>
<DIV>{error,Reason} -></DIV>
<DIV>    io:format("Error: ~s~n", [Reason]),</DIV>
<DIV>   {error,Reason}</DIV>
<DIV>end.</DIV>
<DIV> </DIV>
<DIV>If yes, as I have the following error, I suppose the error is deep.</DIV>
<DIV>If no, could you tell me the correct syntax or document to be read ?</DIV>
<DIV><FONT size=2> </DIV>
<DIV>
<P align=left>application: toto</P>
<P align=left>exited: {bad_return, {{toto,start,[normal,[]]},</P>
<P align=left>{'EXIT', {badarg, [{io,format, [<0.86.0>, "--> Error : 
~s~n",</P>
<P align=left>[{{case_clause,ok}, [{toto_supervisor,init,1}, 
{supervisor,init,1}, {gen_server,init_it,6},</P>
<P align=left>{proc_lib,init_p_do_apply,3}]}]]}, 
{application_master,start_it_old,4}]}}}}</P>
<P align=left>type: temporary </P>
<DIV>J-Ph. Constantin</DIV>
<DIV><A href="mailto:info@its3.ch">info@its3.ch</A></DIV>
<DIV>meyrin/geneva</DIV>
<DIV>switzerland</DIV>
<DIV>+41793265281</DIV></FONT></DIV></BODY></HTML>