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
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?
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