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

Bernard Duggan bernie@REDACTED
Tue Apr 13 05:41:25 CEST 2010


That's because this line:

[RES]=wf:f("~B",[processes:max(1000)]),


is telling Erlang that the call will return a single element list (and
that it should fail with a badmatch if it doesn't).  Instead, it's
returning the string "ok", which is a two element list.  I'm not clear
why, in the thread below, you added the list brackets around RES.

B

Saravana wrote:
> again it appears error friend,
>
> =INFO REPORT==== 13-Apr-2010::08:58:52 ===
> ERROR: error
> {badmatch,"ok"}
> [{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},
>  {httpd_request_handler,handle_response,1},
>
>
> On Apr 12, 11:04 pm, Ryan Huffman <ryanhuff...@REDACTED> wrote:
>   
>> wf:f("~B",[processes:max(1000)])
>>
>> ~B is for displaying integers, but you are trying to display an atom (ok).
>> Try ~w instead.
>>
>> wf:f("~w",[processes:max(1000)])
>>
>> On Mon, Apr 12, 2010 at 10:14 AM, Saravana <navaneetha...@REDACTED> 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 <attila.r.n...@REDACTED>
>>> wrote:
>>>       
>>>> 2010/4/12, Saravana <navaneetha...@REDACTED>:
>>>>         
>>>>> 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-unsubscr...@REDACTED
>>>>         
>>> ________________________________________________________________
>>> erlang-questions (at) erlang.org mailing list.
>>> Seehttp://www.erlang.org/faq.html
>>> To unsubscribe; mailto:erlang-questions-unsubscr...@REDACTED
>>>       
>>     
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>
>   



More information about the erlang-questions mailing list