help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getopt


From: John W. Eaton
Subject: Re: getopt
Date: Sat, 10 Oct 2009 13:50:01 -0400

On 11-Oct-2009, Juergen Rose wrote:

| thank you for the answer. I did not expect that something like getopt is
| not yet implemented in octave. All other languages I use (C, bash, perl,
| R) have such a possibility. For me as a octave newcomer it is not very
| easy to do it.

Procssing getopt-style options is not a common idiom in Octave.

It's relatively inconvenient to do

  result = foo ("-x", x_var, "-y" "-z");

and if you use the command-style syntax:

  foo -x x_var -y -z

instead, you can't assign the result fo the function to a variable and
all the arguments are passed to the function as character strings,
which is not the usuall thing to do for a numerically-oriented
language like Octave.

So I would ask why you want to do this.  If you tell us what you are
trying to do, someone might be able to suggest a convenient way to do
it.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]