Fixed LEAVE N not working

May 20, 2008
9,777
67
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 ...
Code:
v:\> type leaven2.btm
do i=1 to 2
    do j=1 to 2
        leave 2
    enddo
    echo left inner do
enddo
echo i = %i and j = %j

v:\> leaven2.btm
left inner do
left inner do
i = 3 and j = 1
 
May 20, 2008
9,777
67
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
Code:
leave %zz
with
Code:
iff %zz == 1 then
   leave 1
elseiff %zz == 2 then
   leave 2
elseiff %zz == 3 then
   leave 3
endiff
I also noticed that LEAVE (ITERATE also) is not echoed when echo is on ... WAD?
 
May 20, 2008
9,777
67
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?