[fpc-pascal] Can variables be declared within a block?

Reimar Grabowski reimgrab at web.de
Wed Oct 20 16:25:24 CEST 2010


On Tue, 19 Oct 2010 21:18:03 +0100
Vannus <vannus at gmail.com> wrote:

> your example is at the start of a "for loop" block, which is much the same
> as having it at the start of a procedure block
So much the same that you can do it in pascal?
What about variables declared inside this for loop or inside the else block of an if statement.

> pascal prevents people from putting declarations strewn throughout the
> block, which i found reduces mistakes & bugs from 20-30 people coding, and
> their code is more readable. Coding standards are do similar thing.
You were talking about wrong code, not more readable code (which is very subjective in this case). So it looks like there is nothing wrong using this feature if it is available as you failed to show me that there is a problem. But it does not make much sense to discuss this here any further as it is not available in FPC.

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



More information about the fpc-pascal mailing list