[erlang-questions] Re: Display problem while calling sub mod

Ladislav Lenart <>
Mon Apr 12 19:53:22 CEST 2010


Hello.

 From the error message it seems that the function processes:max(1000)
prints the info to the console as a side effect. The function does not
return the printed string, just an atom ok.

Later you try to format that atom using the format string: "~B" which
fails.

If processes:max/1 is your own function, try using io_lib:format/2
which returns the iolist instead of io:format/2 which prints the
string directly to the terminal console and returns atom ok.


HTH,

Ladislav Lenart


Saravana wrote:
> i simply use the below line
> 
>                processes:max(1000),
> 
> to get the output in terminal
> 
> Maximum allowed processes:32768
> PROCESSING TIME FOR EACH REQUEST(CPU TIME AND ELAPSED TIME AVGLY=10.0
> (7.0) mseconds
> 
> when i used to give the below lines to display the result in my
> webpage ,
>                [RES]=wf:f("~B",[processes:max(1000)]),
> 		wf:flash([RES]),
> I get error,
> 
> =INFO REPORT==== 12-Apr-2010::22:38:29 ===
> ERROR: error
> badarg
> [{io_lib,format,["~B",[ok]]},
>  {wf_utils,f,2},
>  {web_index,event,1},
>  {wf_handle_postback,run_module_event,2},
>  {wf_handle_postback,handle_normal_request,3},
>  {wf_inets,do,3},
>  {httpd_response,traverse_modules,2},
>  {httpd_response,generate_and_send_response,1}]
> 
> 
> On Apr 12, 10:01 pm, Attila Rajmund Nohl <>
> wrote:
>> 2010/4/12, Saravana <>:
>>
>>
>>
>>> event(continue) ->
>>>       RES=wf:f("~B",processes:max(1000)),
>>>    wf:flash(RES),
>>> when i execute these statements to display in my webpage, I get error
>> I haven't got the faintest idea what this function does, but based on
>> the info report I'd try something like this:
>>
>> RES=wf:f("~B",[processes:max(1000)]),
>>
>> By the way, are you sure that the processes:max returns what you expect?
>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> Seehttp://www.erlang.org/faq.html
>> To unsubscribe; mailto:
> 
> ________________________________________________________________
> 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