Fixed LEAVE N not working

May 20, 2008
Syracuse, NY, USA
I have several examples. Here's the simplest one. I would not expect to see the "left inner do" message at all. And I would expect that, in the end, i and j are both 1. But ...
v:\> type leaven2.btm
do i=1 to 2
    do j=1 to 2
        leave 2
    echo left inner do
echo i = %i and j = %j

v:\> leaven2.btm
left inner do
left inner do
i = 3 and j = 1
May 20, 2008
Syracuse, NY, USA
I think it's working correctly. My first test failed miserably, apparently because LEAVE's argument can't be in a variable. Could you expand LEAVE's argument?

I had to replace
leave %zz
iff %zz == 1 then
   leave 1
elseiff %zz == 2 then
   leave 2
elseiff %zz == 3 then
   leave 3
I also noticed that LEAVE (ITERATE also) is not echoed when echo is on ... WAD?
May 20, 2008
Syracuse, NY, USA
LEAVE is not a command, so it doesn't (can't) have variable expansion, nor can you echo it or step into it in the debugger. LEAVE and GOTO are about as similar as REM and COPY!
So is variable expansion in a future version out of the question?
Similar threads
Thread starter Title Forum Replies Date
D LEAVE quits btm Support 5
old coot LEAVE appears to affect command-line arguments Support 11
old coot LEAVE in a DO /S fileset loop only leaves one subdirectory Support 4
Peter Murschall A little problem with LEAVE and COMMENT Support 5
P PSHELL not working in TCC 26 Support 9
H @XMLXPATH not working in v28 Support 5
twaterloo FolderMonitor for the 1st time not working Support 5
Tim Rowe NTFS Descriptions not working Support 13
J Batcomp still not working for me in TCMD27 Support 1
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
M Why did BEEP just quit working? Support 12
cgunhouse SETLOCAL not working in BDEBUGGER Support 9
nickles ANSI Colors Windows 7 no longer working Support 6
K ANSI Not Working Support 8
thorntonpg option /u not working The directory name is invalid Support 5
Charles Dye Is the "File Associations" installer dialog working? Support 4
H @ceiling @floor @int not working version 21.01.63 Support 9
K Command Line Selection Not Working Support 12
G Extended directory search not working Support 4
B %@fileseek is not working ? Support 2
C "Take Command has stopped working" Support 1
H New command not working well in Windows 7 Support 4
C "TakeCommand has stopped working" Support 3
N ping DNS lookup not working Support 1
N Updater/silentall not working? Support 1
K Help Not Working Support 11
R Fixed set /r has stopped working in build 35 Support 4
U Keys and IDX not working Support 11
Jesse Heines How to? Everything Tool Not Working After Version 20 Installation Support 8
WavSlave Fixed LIST /U not working in TCC v19 Support 5
Jay Sage %_selected no longer working Support 15
S iftp copying pgp files from ftp is not working Support 11 Extended Directory Searches are not working for me in CDD Support 9
J How to set working directory Support 10
P %date5 not working Support 6
M WAD PDir not working correctly... Support 5
Detlef Fixed ParameterChar in TCMD.INI no longer working Support 35
Jay Sage WAD Variable _LOGFILE Not Working Support 2
I v16 - Shortcuts not working Support 6
rps Fixed Win "set /p" not working in V17 build 53 Support 3
Jay Sage Toolbar Update to INI File Not Working Support 10
Jay Sage Ctrl-C Not Working Reliably to Copy Screen Content Support 4
Jay Sage Unknown_CMD Not Working Support 4
fromano Fixed /E not working in TCMD 17.0.40 while doing one way synch Support 1
R WAD Copy's command dialogue not working Support 2
C WAD @index not working in v16 x64 Support 14
Dan Glynhampton Fixed @version "force" flag not working, and unable to set separator Support 3
C RSS feed subscription not working Support 9
M @Index not working like I thought it would... Support 2
C Working with links Support 6

Similar threads