Welcome!

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

SignUp Now!

Fixed LEAVE N not working

May
12,846
164
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
 
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?
 
I also noticed that LEAVE (ITERATE also) is not echoed when echo is on ... WAD?
And LEAVE can't be "stepped into" in the debugger (I didn't check ITERATE). Both are unlike GOTO which is a seemingly analogous command.
 
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

Back
Top