Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.pascal.borland    |    Borland Pascal was actually pretty neat    |    2,978 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 2,305 of 2,978    |
|    Henry Bartlett to robert    |
|    Re: continue/break loop early in Pascal?    |
|    13 Dec 06 11:20:44    |
   
   XPost: comp.lang.pascal.delphi.misc   
   From: hambar@Spamlock.microtech.com.au   
      
   "robert" wrote   
      
   > I found only the terrible "goto" in the docs. Is this all Pascal   
   > has?   
      
   It all depends on the flavour of Pascal.   
      
   "break", "continue" and "exit" were introduced in Turbo Pascal 7.   
      
   They were not in TP6 but are in Delphi.   
      
   I don't know what "next" does.   
      
   But you can still do what you want to do in earlier Pascals by   
   rearranging your code.   
      
   begin   
    repeat   
    dosomething1; // eg inc(i);   
    if not cond1 then // if cond1 then skip to nest item   
    dosomething2;   
    until cond2 or cond3;   
    if not cond3 then // if cond3 then "return early"   
    dosomething3;   
   end;   
      
   BTW infinite loops such as   
   > while True do   
   are usually shunned by most Pascal programmers as is the   
   'terrible "goto"'.   
      
   > How to jump to an absolute memory address? jmp 0xFFFF:0xFFF0 ??   
      
   Why would you want to do this?   
      
   I can get to any memory address that I need to by looking in a named   
   variable.   
      
   Check out the @ operator.   
      
   --   
   Henry Bartlett   
   Delphi Links Page:   
   ( http://www.hotkey.net.au/~hambar/habit/delflink.htm )   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca