By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!This also seems to work.
Code:gosub subroutine >&NUL echo subroutine returned quit :subroutine echo foo netstat.exe garbage echoerr foo return
Yup. I never use parentheses that don't begin and end on the same line. Here's another that seems to work. You can even send some output to CON: (as I did below).I prefer the second version. Grouping lines together with parentheses mashes them into a single virtual line, which can have unexpected side effects.
>&NUL do i=1 to 1
echo foo > con:
netstat.exe
garbage
echoerr foo
enddo
do | command | command [...]
...
enddo
do i=0 to %lastline by 7 | d:\gnu\sort %sortargs %filter %@if[defined tail,| TAIL /N %tail,]
v:\> do i=1 to 2 ( echo foo ) > nul
Usage : DO [n | FOREVER]
v:\> (do i=1 to 2 ( echo foo )) > nul
v:\>
You mean, other shell languages? It depends on the language.Vince, I noticed that in some of your examples above you put redirection commands at the beginning of the line. The TCC help says that they should be placed at the end of the command line. I just experimented and discovered that they, indeed, can be placed at the beginning or the end. Is placing them at the beginning something that is common in other programming environments?
d:\data\tcclibrary> (do i = 1 to 3 ( echo i = %i )) > junk.txt
d:\data\tcclibrary> type junk.txt
i = 1
i = 2
i = 3
d:\data\tcclibrary> >junk.txt (do i = 1 to 3 ( echo i = %i ))
d:\data\tcclibrary> type junk.txt
i = 4
i = 4
i = 4
d:\data\tcclibrary> >junk.txt (echo foo)
d:\data\tcclibrary> type junk.txt
foo