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 juergen.hesterm...@gmx.de 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

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

[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

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

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

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 (except in

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 shortstring