Quoting Bert Wesarg <[EMAIL PROTECTED]>:
> > Indeed you are. $args[1] is the same as $1, and when you copy $args to
> another
> > array, it's still index 1. A bit bizarre but I wanted things to work in
> a way
> > analogous to parameter lists, hence the args() built-in.
> Ok, I just wanted to be sure that this was intended.
>
> Bert
> >
> > Tony
Yup. Perhaps more clearly and usefully, it can be used for assigning
required positional parameters, a technique I neglected to mention
eg
define myfunc {
(a, b, c, d) = $args
...
}
instead of
define myfunc {
a = $1
b = $2
c = $3
d = $4
...
}
Maybe one day we'll even have
define myfunc(a, b, c, d) {
...
}
Tony
PS re multisel, I have (in dev) a version of list_dialog() that uses Joachim's
keyword parameters for various extra stuff difficult to express cleanly using
positional parameters
eg
buttonarray = args("OK", "Try again", "Cancel")
res = list_dialog("Title",
"a\nlong\nlist\nof\nvalues",
.select = "multi",
.selected = "a\nlist",
.string = "default value",
.buttons = buttonarray)
which is like the current extension with "multi_sel" and "string" parameters
but no conflict between keywords and button labels, adding preselected lines
(with the .selected value) - the first of which (at least) will be visible
initially - and pre-filling the string entry area.
You can still supply positional buttons too, or an array of them as an unnamed
positional parameter. I've started to use these features, and they're nice.
Tony
--
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop