Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Done DO varname IN @TMP:

Aug
1,927
70
The help says that DO varname IN only works with @CLIP:, not @TMP:
DO command - Create loops in Windows batch files
DO varname IN @file executes the commands between DO and ENDDO once for every line in file, setting varname to the content of each one in turn. Beware of characters with special meaning to TCC, such as redirection and piping symbols, within the file (use SETDOS /X as needed).

To execute the loop once for each line of text in the clipboard, use CLIP: (or CLIP0: - CLIP9:) as the file name (e.g. DO X IN @CLIP:). CLIP: will not return any data unless the clipboard contains text. See Redirection for more information on CLIP:.

Please allow @TMP: to be used with DO varname IN

Joe
 
It's OK here.

Code:
v:\> echo foo^r^nbar^r^nfly > tmp9:

v:\> do x in @tmp9: (echo %x)
foo
bar
fly

v:\> echo foo^r^nbar^r^nfly > tmp:

v:\> do x in @tmp: (echo %x)
foo
bar
fly
 
Thanks @vefatica

The following now works...
Code:
@SETLOCAL
@ECHO OFF
tmp /c 9
Gosub Init > tmp9:
REM How many lines in tmp9:
echo @Lines: 0-%@lines[tmp9:]
REM Display the lines in tmp9:
do theDate in @TMP9:
  echo %theDate
enddo
ENDLOCAL
quit

:Init
text
1950-01-28
1956-01-28
1961-01-28
1967-01-28
1978-01-28
1984-01-28
1989-01-28
1995-01-28
2006-01-28
2012-01-28
2017-01-28
2023-01-28
endtext
Return

Joe
 
Back
Top