As an alternative to the Args object, a map of arguments would provide a simple way of establishing how many were specified and the ability to process them by enumeration. For example:
ArgsMap.count = 4;
for (var e = new Enumerator(ArgsMap); !e.atEnd(); e.moveNext())
{
var key = e.item();
var value = map(key);
DOpus.Output(key + " -> " + value);
}
somebool -> true
somestring -> hello world
someinteger -> 12
somevector -> vector object, e.g.
somevector(0) = the quick
somevector(1) = brown fox
somevector(2) = etc
What about just a Set of used argument names? You could then loop through that and get the values or other details out of the normal Args object.
As well as normal argument parsing, or instead of*?
(* Which would be like having a single, default /R raw argument if that was possible. I don't think it is currently since there's no way to make something default if it's already /R right now.)
As well as. It would provide a simple way for a user command to process a supplied string without having to be concerned about parsing against a template or prefixing with an argument name.
Very good. I never knew about the cmdline property. After reading the relevant section in the help file and trying it out for myself, can I suggest that you also document the cmdline property in the ClickData section which describes func but not cmdline.
cmdline isn't part of ClickData, which is passed to script buttons. Script buttons don't have command line templates or arguments at all. (You can't pass arguments to a button; only to a command run within a button or script.)
cmdline is only part of ScriptCommandData, which is passed to script commands.