Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-18 Thread Marco van de Voort
In our previous episode, Juha Manninen said: > On Wed, Jun 18, 2014 at 2:36 PM, Bart wrote: > > The original code removes trailing spaces only, and Trim() removes > > more than spaces (and it removes leading blanks as well). > > Filename := TrimRight(Filename); or Filename := TrimRightSe

Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-18 Thread Juha Manninen
On Wed, Jun 18, 2014 at 2:36 PM, Bart wrote: > The original code removes trailing spaces only, and Trim() removes > more than spaces (and it removes leading blanks as well). Filename := TrimRight(Filename); :) Juha ___ fpc-pascal maillist - fpc-pa

Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-18 Thread Bart
On 6/18/14, Juha Manninen wrote: > How about : > Filename := Trim(Filename); The original code removes trailing spaces only, and Trim() removes more than spaces (and it removes leading blanks as well). Bart ___ fpc-pascal maillist - fpc-pascal@li

Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-18 Thread Juha Manninen
On Wed, Jun 18, 2014 at 6:42 AM, Ralf Quint wrote: > A totally different solution and also more universal (not depending on the > length of the filename to be exactly 8 characters long would be > >while ((Length (Filename) > 0) AND (Filename (Length (Filename) = ' ') do >Delete (Filena

Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-18 Thread Ralf Quint
On 6/17/2014 7:54 PM, Jim Leonard wrote: The error is because FreePascal optimizes loops wherever it can, and trying to modify the loop variable would break under that optimization. While you could enable compilation flags to make things more TP compatible, looking at the code, I can see that

Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-17 Thread Sven Barth
Am 18.06.2014 04:55 schrieb "Jim Leonard" : > > The error is because FreePascal optimizes loops wherever it can, and trying to modify the loop variable would break under that optimization. > > While you could enable compilation flags to make things more TP compatible, looking at the code, I can see

Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-17 Thread Jim Leonard
The error is because FreePascal optimizes loops wherever it can, and trying to modify the loop variable would break under that optimization. While you could enable compilation flags to make things more TP compatible, looking at the code, I can see that the 'counter:=1' is just an early termina

Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-17 Thread Sven Barth
Am 17.06.2014 13:17 schrieb "Jonas Maebe" : > > > On 17 Jun 2014, at 13:05, mokashe.ram wrote: > >> Could Any one help me for fixing below error in free pascal. as i am tring >> to excute for loop in decemental order using 'DOWNTO' but its thwoing error >> 'Illeagal assignment to For Loop variable

Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-17 Thread Jonas Maebe
On 17 Jun 2014, at 13:05, mokashe.ram wrote: Could Any one help me for fixing below error in free pascal. as i am tring to excute for loop in decemental order using 'DOWNTO' but its thwoing error 'Illeagal assignment to For Loop variable 'Counter' as this is possible in TP but in Free pasc

Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-17 Thread Ewald
On 17 Jun 2014, at 13:05, mokashe.ram wrote: > Hi, > > Could Any one help me for fixing below error in free pascal. as i am tring > to excute for loop in decemental order using 'DOWNTO' but its thwoing error > 'Illeagal assignment to For Loop variable 'Counter' as this is possible in > TP but in

[fpc-pascal] Illeagal assignment to For Loop variable in Free pascal

2014-06-17 Thread mokashe.ram
Hi, Could Any one help me for fixing below error in free pascal. as i am tring to excute for loop in decemental order using 'DOWNTO' but its thwoing error 'Illeagal assignment to For Loop variable 'Counter' as this is possible in TP but in Free pascal its not working so is there any workaround for