Please excuse me if this is a set of stupid questions; I'm rather fond of stupid questions at this point in my life. So, here is a "sample" function definition (purely for illustration purpose; it's not the final version of the function that I'm actually trying to write):
[Z:\]echo %@Sample[*.txt]
@Eval[@FileSize[ *.txt,b,]/@Files[ *.txt]]
[Z:\]echo %@Sample[*.txt,/S]
@Eval[@FileSize[/S *.txt,b,]/@Files[/S *.txt]]
[Z:\]echo %@Sample[*.txt,/S,a]
@Eval[@FileSize[/S *.txt,b,a]/@Files[/S *.txt]]
[Z:\]echo %@Sample[*.txt,,a]
@Eval[@FileSize[ *.txt,b,a]/@Files[ *.txt]]
Exactly what I would hope for.
So here's function definition in the "attempt" to make the function more "real":
And here's the "results" of trying to invoking the above function:
[Z:\]echo %@Sample[*.txt,/S]
@Eval[21547243/186]
[Z:\]echo %@Sample[*.txt]
@Eval[21546573/185]
[Z:\]echo %@Sample[*.txt,/S]
@Eval[21547243/186]
[Z:\]echo %@Sample[*.txt,/S,a]
@Eval[22085632/186]
[Z:\]echo %@Sample[*.txt,,a]
@Eval[-1/0]
[Z:\]echo %@Sample[*.txt,``,a]
@Eval[-1/0]
Not exactly what I would expect. And, more importantly, incorrect!!!
So, the questions are, of course, what is going on here and what am I doing wrong and how do I fix it?
Function Sample=`@Eval[@FileSize[%2 %1,b,%3]/@Files[%2 %1]]`
And here's the "results" of invoking said function:[Z:\]echo %@Sample[*.txt]
@Eval[@FileSize[ *.txt,b,]/@Files[ *.txt]]
[Z:\]echo %@Sample[*.txt,/S]
@Eval[@FileSize[/S *.txt,b,]/@Files[/S *.txt]]
[Z:\]echo %@Sample[*.txt,/S,a]
@Eval[@FileSize[/S *.txt,b,a]/@Files[/S *.txt]]
[Z:\]echo %@Sample[*.txt,,a]
@Eval[@FileSize[ *.txt,b,a]/@Files[ *.txt]]
Exactly what I would hope for.
So here's function definition in the "attempt" to make the function more "real":
Function Sample=`@Eval[%@FileSize[%2 %1,b,%3]/%@Files[%2 %1]]`
And here's the "results" of trying to invoking the above function:
[Z:\]echo %@Sample[*.txt,/S]
@Eval[21547243/186]
[Z:\]echo %@Sample[*.txt]
@Eval[21546573/185]
[Z:\]echo %@Sample[*.txt,/S]
@Eval[21547243/186]
[Z:\]echo %@Sample[*.txt,/S,a]
@Eval[22085632/186]
[Z:\]echo %@Sample[*.txt,,a]
@Eval[-1/0]
[Z:\]echo %@Sample[*.txt,``,a]
@Eval[-1/0]
Not exactly what I would expect. And, more importantly, incorrect!!!
So, the questions are, of course, what is going on here and what am I doing wrong and how do I fix it?