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

2010-10-18 Thread Zaher Dirkey
On Thu, Oct 14, 2010 at 11:21 AM, Michael Van Canneyt mich...@freepascal.org wrote: On Thu, 14 Oct 2010, Frank Church wrote: Can variables be declared within a begin end block? No. That found in Gnu Pascal Can we ask to be feature request? Thanks -- Zaher Dirkey

RE: [fpc-pascal] TR: Strange Behaviour of TBits

2010-10-18 Thread Julien Devillers
-Message d'origine- De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Jonas Maebe Envoyé : vendredi 15 octobre 2010 11:11 À : FPC-Pascal users discussions Objet : Re: [fpc-pascal] TR: Strange Behaviour of TBits On 14 Oct 2010,

[fpc-pascal] IntList

2010-10-18 Thread Juha Manninen (gmail)
Hi In Lazarus project jcf2 component has an IntList class which is poorly implemented. It depends on integer and pointer being the same size. I will later suggest to replace it. I have a better IntList. See: http://github.com/JuhaManninen/Pascal/blob/master/IntList/intlist.pas It is similar

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

2010-10-18 Thread Frank Church
On 18 October 2010 07:49, Florian Klaempfl 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 wrote: On Thu, 14 Oct 2010, Frank Church wrote:

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

2010-10-18 Thread Lukasz Sokol
On 18/10/2010 13:58, Frank Church wrote: On 18 October 2010 07:49, Florian Klaempfl flor...@freepascal.org wrote: [...] No. That is a rather emphatic no :). Is there some performance or other related reason why it is a bad idea? I'm not knowledgeable in this area but I'd like to

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

2010-10-18 Thread Florian Klaempfl
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

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

2010-10-18 Thread Bernd Kreuss
On 18.10.2010 15:19, Lukasz Sokol wrote: Having variables declared within code block used to require to parse the source code at least 2 times Or create them on the stack at the begin and remove them at the end of the block (which would be the only way to have some additional functionality

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

2010-10-18 Thread Frank Church
On 18 October 2010 14:42, Florian Klaempfl flor...@freepascal.org wrote: 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:

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

2010-10-18 Thread Frank Church
On 18 October 2010 14:55, Frank Church vfcli...@gmail.com wrote: On 18 October 2010 14:42, Florian Klaempfl flor...@freepascal.org wrote: 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:

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

2010-10-18 Thread Bernd Kreuss
On 18.10.2010 15:55, Frank Church wrote: I just want to create shorter variables like si := StringList.NameOfIndex(TableName.FieldByName('').AsString); ae := xxx; so:= yyy to express complicated logic with them. Maybe the usage of WITH could be helpful in some of these cases Bernd

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

2010-10-18 Thread Bernd Kreuss
On 18.10.2010 15:55, Frank Church wrote: I understand the need to avoid stuff that could create unintended errors It would create something that I would call irregularity (or even ugliness) in the language grammar. Nowhere else is it ever allowed to have certain things inside a begin/end block,

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

2010-10-18 Thread Michael Van Canneyt
On Mon, 18 Oct 2010, Bernd Kreuss wrote: On 18.10.2010 15:55, Frank Church wrote: I understand the need to avoid stuff that could create unintended errors It would create something that I would call irregularity (or even ugliness) in the language grammar. Nowhere else is it ever allowed

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

2010-10-18 Thread Benedikt Schindler
I just want to create shorter variables like si := StringList.NameOfIndex(TableName.FieldByName('').AsString); ae := xxx; so:= yyy to express complicated logic with them. When I put them all at the top of the procedure, they are extra noise, which is

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

2010-10-18 Thread Sven Barth
Am 18.10.2010 16:20, schrieb Michael Van Canneyt: Object Pascal is a simple, beautiful and easy to read language. The FPC team tries to keep it that way. And that is why I like the FPC team so much. :D Regards, Sven ___ fpc-pascal maillist -

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

2010-10-18 Thread David W Noon
On Mon, 18 Oct 2010 15:42:31 +0200, Florian Klaempfl wrote about Re: [fpc-pascal] Can variables be declared within a block?: [snip] 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

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

2010-10-18 Thread Vannus
On 18 October 2010 15:33, Sven Barth pascaldra...@googlemail.com wrote: Am 18.10.2010 16:20, schrieb Michael Van Canneyt: Object Pascal is a simple, beautiful and easy to read language. The FPC team tries to keep it that way. And that is why I like the FPC team so much. :D agreed. When

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

2010-10-18 Thread Reimar Grabowski
On Mon, 18 Oct 2010 19:21:57 +0100 Vannus van...@gmail.com wrote: Since then, i would say If you need vars throughout your code, then something is wrong with your code for (int i = 0;...) Can't see anything wrong. I use declaration of variables inside blocks quite often in Java and C++ but

[fpc-pascal] non visual timer win32

2010-10-18 Thread Justin Smyth
Guys i have an app on win32 that runs a timer when a form is hidden , any ideas how i get a timer to work when the form is hidden ? Kind Regards Delphian___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

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

2010-10-18 Thread Andreas Berger
for (int i = 0;...) Can't see anything wrong. I use declaration of variables inside blocks quite often in Java and C++ but have never missed it in pascal. Please enlighten me. What is so bad about creating temporary variables inside blocks instead of the beginning of a function in a language

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

2010-10-18 Thread David W Noon
On Mon, 18 Oct 2010 19:46:04 -0200, Andreas Berger wrote about Re: [fpc-pascal] Can variables be declared within a block?: for (int i = 0;...) Can't see anything wrong. I use declaration of variables inside blocks quite often in Java and C++ but have never missed it in pascal. Please

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

2010-10-18 Thread Andreas Berger
But it should make you wonder why this is no longer allowed in the latest C++ standards. What do you mean? The current C++ standard (ISO 1998+TR1) permits short scope declarations. Indeed, C++ permits declarations to appear anywhere, not just after a { to open a function or compound

[fpc-pascal] ReadStr/WriteStr vs Val/Str

2010-10-18 Thread Richard Ward
As a user of the old Macintosh Pascal (later THINK Pascal), both ReadStr and WriteStr functions were included and I used them quite a bit. The names were different but the FPC implementation is basically the same as far as I can tell. Besides backward compatibility, portability issues and

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

2010-10-18 Thread Dimitri Smits
- Bernd Kreuss prof7...@googlemail.com schreef: On 18.10.2010 15:19, Lukasz Sokol wrote: Having variables declared within code block used to require to parse the source code at least 2 times Or create them on the stack at the begin and remove them at the end of the block (which

[fpc-pascal] Re: ReadStr/WriteStr vs Val/Str

2010-10-18 Thread Paul Nicholls
Richard Ward row...@mac.com wrote in message news:6707d87e-2ea6-4469-97a5-cf55d1a04...@mac.com... As a user of the old Macintosh Pascal (later THINK Pascal), both ReadStr and WriteStr functions were included and I used them quite a bit. The names were different but the FPC implementation is

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

2010-10-18 Thread Jerry
On Oct 18, 2010, at 6:42 AM, Florian Klaempfl wrote: Am 18.10.2010 14:58, schrieb Frank Church: 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: So don't allow identical names. Ada allows exactly this

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

2010-10-18 Thread Jürgen Hestermann
Reimar Grabowski schrieb: for (int i = 0;...) Can't see anything wrong. I use declaration of variables inside blocks quite often in Java and C++ but have never missed it in pascal. Please enlighten me. What is so bad about creating temporary variables inside blocks instead of the beginning of