Re: [fpc-pascal] private integer is an illegal counter variable

2009-11-30 Thread Flávio Etrusco
On Sat, Nov 28, 2009 at 7:12 AM, Jürgen Hestermann wrote: >> And there are many reasons why there are so many string types nowadays. > > True. > >> Simply use {mode objfpc}{$h+} like lazarus suggests. > > I think the root cause of all these problems are generic types. They cause > more trouble tha

Re: [fpc-pascal] private integer is an illegal counter variable

2009-11-28 Thread Jürgen Hestermann
And there are many reasons why there are so many string types nowadays. True. Simply use {mode objfpc}{$h+} like lazarus suggests. I think the root cause of all these problems are generic types. They cause more trouble than they avoid. I would suggest that noone never uses such generic typ

Re: [fpc-pascal] private integer is an illegal counter variable

2009-11-27 Thread Juha Manninen
On lauantai, 28. marraskuuta 2009 00:49:25 Jonas Maebe wrote: > On 27 Nov 2009, at 23:43, Juha Manninen wrote: > > I understand it is important to support also the old shortstring but it > > should be defined explicitly and "string" should always mean just one > > thing. > > ansistring and shortst

Re: [fpc-pascal] private integer is an illegal counter variable

2009-11-27 Thread Mattias Gaertner
On Sat, 28 Nov 2009 00:43:39 +0200 Juha Manninen wrote: > On perjantai, 27. marraskuuta 2009 23:52:30 Frank Peelo wrote: > > > The reason is that a for-loop tries to make a number of reasonable > > > guarantees that the counter variable cannot be modified during the loop. > > > E.g., direct assig

Re: [fpc-pascal] private integer is an illegal counter variable

2009-11-27 Thread Jonas Maebe
On 27 Nov 2009, at 23:43, Juha Manninen wrote: > I understand it is important to support also the old shortstring but it > should > be defined explicitly and "string" should always mean just one thing. ansistring and shortstring always mean just one thing. "string" originally meant shortstrin

Re: [fpc-pascal] private integer is an illegal counter variable

2009-11-27 Thread Juha Manninen
On perjantai, 27. marraskuuta 2009 23:52:30 Frank Peelo wrote: > > The reason is that a for-loop tries to make a number of reasonable > > guarantees that the counter variable cannot be modified during the loop. > > E.g., direct assignments to a counter variable are forbidden inside the > > loop (ex

Re: [fpc-pascal] private integer is an illegal counter variable

2009-11-27 Thread Frank Peelo
Jonas Maebe wrote: On 27 Nov 2009, at 15:49, Juha Manninen wrote: If I define a private integer: TDemo = class(TCustomApplication) private i: integer; ... and in a protected method I use it: for i := 0 to List.Count - 1 do ... then I get an error: Error: Illegal counter variabl

Re: [fpc-pascal] private integer is an illegal counter variable

2009-11-27 Thread Jonas Maebe
On 27 Nov 2009, at 15:49, Juha Manninen wrote: If I define a private integer: TDemo = class(TCustomApplication) private i: integer; ... and in a protected method I use it: for i := 0 to List.Count - 1 do ... then I get an error: Error: Illegal counter variable Moving it to meth

[fpc-pascal] private integer is an illegal counter variable

2009-11-27 Thread Juha Manninen
Hello, If I define a private integer: TDemo = class(TCustomApplication) private i: integer; ... and in a protected method I use it: for i := 0 to List.Count - 1 do ... then I get an error: Error: Illegal counter variable Moving it to method's var section helps. Method's va