[erlang-questions] Re: command-line args in erl

Jordan Wilberding diginux@REDACTED
Thu Apr 15 23:28:57 CEST 2010


erl -noshell -s render main 200 200 > Mandelbrot.ppm

(using the original code)

Thanks!
JW

On Thu, Apr 15, 2010 at 4:25 PM, Wes James <comptekki@REDACTED> wrote:

> On Thu, Apr 15, 2010 at 3:10 PM, Wes James <comptekki@REDACTED> wrote:
> > I am running through the mandelbrot example from:
> >
> >
> http://projects.trapexit.org/web/#/web/project/github::ghulette::mandelbrot-erlang
> >
> > and it has:
> >
> > main([WArg,HArg]) ->.....
> >
> > so you can provide command-line args like main 200 200, but how do you
> > do provide command line args in erl?
> >
>
> <snip>
>
> I changed main to main(WArg,HArg) ->
>
> and this code:
>
> main(WArg,HArg) ->
>  W = WArg, %list_to_integer(atom_to_list(WArg)),
>  H = HArg, %list_to_integer(atom_to_list(HArg)),
>  MaxI = 255,
>  render(W,H,MaxI),
>  init:stop().
>
>
> to just have single value and it works for testing.   I'm still
> wondering how to pass args in erl though - or is the [var1, var2]
> always interpreted as command line args are expected?
>
> thx,
>
> -wes
>
> ________________________________________________________________
> 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