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,328 of 2,978    |
|    Dr Engelbert Buxbaum to robert    |
|    Re: continue/break loop early in Pascal?    |
|    18 Dec 06 21:02:35    |
      XPost: comp.lang.pascal.delphi.misc       From: engelbert_buxbaum@hotmail.com              robert wrote:              > Sorry for dummy Pascal question - I have to fumble in an old TP6.0       > Pascal program and I was on Pascal some 10 years ago..       >       > How can one break out / continue a loop early in Pascal - thus what is       > "break" / "continue" / "next" / "return" in C, Python, ...       > And how to return early from a function / procedure?       >       > procedure xy;       > begin       > while True do begin       > if cond1=True then ?continue?;       > if cond2=True then ?break?;       > if cond3=True then ?return?;       > end;       > end;       >       > I found only the terrible "goto" in the docs. Is this all Pascal has?       >              You can leave a loop or function early with exit, and you can terminate       the program with halt. Both should be used sparingly, as they are in       effect hidden gotos. They are usually used to leave after error       conditions, when the use of if/then/else structures would result in       cluttered code.              > Also:       > How to jump to an absolute memory address? jmp 0xFFFF:0xFFF0 ??              You don't, that is BASIC-style programming. In Pascal you call a       procedure or function, in hardware-near cases via the exitproc-chain. In       addition, there are fuction variables which you may whish to look into.              --- 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