[fpc-pascal] Legitimate use of for and break

Tomas Hajny XHajT03 at hajny.biz
Sun Jun 18 04:25:50 CEST 2023


On 2023-06-18 03:04, Hairy Pixels via fpc-pascal wrote:
>> On Jun 18, 2023, at 1:07 AM, tsiegel at softcon.com wrote:
>> 
>> This is interesting, because it's the first time I've ever seen 
>> "break" as a valid command in pascal, and I've been using pascal since 
>> the mid/late 80s.  All kinds of dialects too, and I've never seen 
>> break as a keyword.  C, Python, Perl, sure, even shell scripts, but 
>> pascal? Never seen it used before.  Is this a relatively new addition 
>> to fpc or something?
> 
> I don't remember break NOT being in Pascal. How did you exit a loop
> otherwise, goto? Break is common in basically all languages now. Can't
> think of a language I've used without it.

Obviously, loop is exited using the loop condition by default and that 
may be achieved without additional constructs, should it be break or 
goto. Yes, using break may be more elegant in certain cases, but that's 
another story.

Tomas


More information about the fpc-pascal mailing list