- May
- 13,802
- 211
This is a drastic simplification of what (I think) is going on it the DO/pipe thread. It uses only internals and Windows's SORT.EXE. Now it seems to have something to do with @EXECARRAY and @EXECSTR but I'm pretty much at a loss and that's just a guess. Using these two BTMs (attached) ...
This is what I get from v25 build 21.
In contrast, this (which is expected) is what I get from v25 build 20.
Code:
v:\simplified> type caller.btm
echo %@word[1,%@execstr[call .\callee.btm | ffind /vkme"average"]]
Code:
v:\simplified> type callee.btm
setarray /f z[5]
echo %@execarray[z,echo 5^r^n4^r^n3^r^n2^r^n1 > tmpfile] > NUL
c:\windows\system32\sort tmpfile
echo average 666
unsetarray z
This is what I get from v25 build 21.
Code:
v:\simplified> callee.btm
1
2
3
4
5
average 666
v:\simplified> caller.btm
<output file>
The pipe is being closed.
ECHO is OFF
In contrast, this (which is expected) is what I get from v25 build 20.
Code:
v:\simplified> callee.btm
1
2
3
4
5
average 666
v:\simplified> caller.btm
666