DO /P ... is this possible ... ?

May 20, 2008
12,165
133
Syracuse, NY, USA
Hmmm! Putting the /P command in parens does work (in other cases).
Code:
v:\ipreg\country> do line in /p (echo foo^r^nbar) (echo %_do_loop %line)
1 foo
2 bar
 
May 20, 2008
12,165
133
Syracuse, NY, USA
So I guess the answer tp my original question is "yes". And getting it to work is a matter of doubling up some %s.
Code:
v:\ipreg\country> do x in /p ( do i=1 to 3 ( echo %%@eval[%%i**2]) ) ( echo %x foo )
1 foo
4 foo
9 foo

The same goes for Scott's example.
Code:
v:\ipreg\country> echo %@execstr[do i=1 to 5 (echos ` `%%i)]
 1 2 3 4 5

This is what I wanted to do in the first place. And it works!
Code:
v:\ipreg\country> do line in /p (do l in /p grep RU ipcountry.txt (echo %%@eval[0x%%@word[1,%%l]-0x%%@word[0,%%l]+1])) (set /a /q RUSUM+=%line)

v:\ipreg\country> echo %rusum
45162496
 

Similar threads

D
Replies
0
Views
2K
D