To start, I'll spare the reader from why I want to do this; and so there are hopefully absolutely no unanswered questions about what I am trying to do and the results I am getting, here is a complete transcript of a function definition and the results of invoking said function:
Function Sample=`^n %%$: "%$"^n %%2: "%2"^n %%#: "%#"^n %%-3%: "%-3$"^n%%[1]: "%[1]"`
[Z:\]Echo %@Sample[abc fghij nopqrs uvwxyz]
%$: "abc fghij nopqrs uvwxyz"
%2: "fghij"
%#: "4"
%-3: "fghij"
%[1]: ""
And to quickly summarize if it is not obvious, "%[1]" returns a null string.
Since, as far as I know I really need this functionality and I no of no other (simple!) way to get it, am I doing something wrong or is there a simple way to fix it (i.e., %[1] returning the first argument to the function), or will I just plain have to "investigate" the far more complicated option(s)?
- Dan
Function Sample=`^n %%$: "%$"^n %%2: "%2"^n %%#: "%#"^n %%-3%: "%-3$"^n%%[1]: "%[1]"`
[Z:\]Echo %@Sample[abc fghij nopqrs uvwxyz]
%$: "abc fghij nopqrs uvwxyz"
%2: "fghij"
%#: "4"
%-3: "fghij"
%[1]: ""
And to quickly summarize if it is not obvious, "%[1]" returns a null string.
Since, as far as I know I really need this functionality and I no of no other (simple!) way to get it, am I doing something wrong or is there a simple way to fix it (i.e., %[1] returning the first argument to the function), or will I just plain have to "investigate" the far more complicated option(s)?
- Dan