Re: while do & end while

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi timelord,

----------
> Îò: timelord at zebra.net
> Êîìó: EUforum <EUforum at topica.com>
> Òåìà: while do & end while
> Äàòà: Saturday, January 19, 2002 20:44

> >while 1 do 
> >if condition1 then exit end if 
> >if conditionN then return end if 
> >end while

> I think I understand that, too?   
> 
> while 1 do   
>    --/ when condition1 is True, it will exit the loop   
>    --/ and finish anything else in the procedure.
> if condition1 then exit end if     
>    --/ when conditionN is True, it will exit the procedure!
> if conditionN then return end if  
> end while

This more detaled may be:

procedure Loop()
   while 1 do --- loop #1
   .......  --some operators
      if condition1 then exit end if   -- exit from loop #1 to loop #2
   .......  --some operators
      if conditionN then return end if -- return from Loop() procedure,
skip loop #2
   .......  --some operators
  end while
  
  while 2 do --- loop #2
   .......  some operators
      if conditionK then exit end if   -- exit from loop #2 and then finish
                                       -- of Loop() procedure
   .......  --some operators
  end while
end procedure

Loop()

Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu