Am 18.10.2010 14:58, schrieb Frank Church: > > > On 18 October 2010 07:49, Florian Klaempfl <flor...@freepascal.org > <mailto:flor...@freepascal.org>> wrote: > > Am 18.10.2010 08:17, schrieb Zaher Dirkey: > > > > > > On Thu, Oct 14, 2010 at 11:21 AM, Michael Van Canneyt > > <mich...@freepascal.org <mailto:mich...@freepascal.org> > <mailto:mich...@freepascal.org <mailto:mich...@freepascal.org>>> wrote: > > > > > > > > On Thu, 14 Oct 2010, Frank Church wrote: > > > > Can variables be declared within a begin end block? > > > > > > No. > > > > > That is a rather emphatic no :). > Is there some performance or other related reason why it is a bad idea?
It's just a matter of readability, e.g. having a variable declared in two blocks with the same name can cause you a lot of headache: procedure p; begin ... begin var i : integer; ... ... ... i:=12341234; ... ... ... ... end; ... ... ... begin var i : integer; ... writeln(i); <--- this i is not the same as above so i does not contain 12341234 but it contains probably some garbage. end; _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal