Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal
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 that the 'counter:=1' is just an early termination clause. If the variable 'counter' isn't needed after that section, you could replace that line with 'break' which would exit the loop immediately (which is what the code does now). One shouldn't assume anything about the loop variable after the execution of the loop anyway *except* the loop was left using Break or Goto. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal
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 termination clause. If the variable 'counter' isn't needed after that section, you could replace that line with 'break' which would exit the loop immediately (which is what the code does now). On 6/17/2014 6:05 AM, 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 Free pascal its not working so is there any workaround for this? FOR counter := 8 DOWNTO 1 DO IF filename[counter] = ' 'THEN DELETE(filename,counter,1) ELSE counter := 1; Thanks Sudarshan -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Illeagal-assignment-to-For-Loop-variable-in-Free-pascal-tp5719603.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal -- Jim Leonard (trix...@oldskool.org) Check out some trippy MindCandy: http://www.mindcandydvd.com/ A child borne of the home computer wars: http://trixter.oldskool.org/ You're all insane and trying to steal my magic bag! ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Tdbf Memo Field Issue, 2.6.2 vs 2.6.4
On 06/17/2014 07:07 AM, Reinier Olislagers wrote: > Got some questions/remarks/workaround for you in the bug report... > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal Answers are posted to the bug report. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal
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 'Counter' as this is possible in >> TP but in Free pascal its not working so is there any workaround for this? > > > You should probably compile the code with -Mtp to switch FPC into (mostly) TP-compatible mode. There are more differences between TP and FPC that you'll encounter otherwise. As an alternative to the command line option -Mtp you can also add {$mode tp} at the top of the source file (before the uses-clause at least). Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Support for new MS SQL 2008 datetime data types - Revision 27981 - by lacaK
On Tue, Jun 17, 2014 at 2:11 AM, LacaK wrote: > Marcos Douglas wrote / napĂsal(a): > > On Mon, Jun 16, 2014 at 11:36 AM, Michael Van Canneyt > wrote: > > > On Mon, 16 Jun 2014, Reinier Olislagers wrote: > > > > On 16/06/2014 15:45, Marcos Douglas wrote: > > > Hi Laco, > > About this update: > http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=27981 > > Could you explain what new types are these, please? > > > See bug report > http://bugs.freepascal.org/view.php?id=26235 > > And undoubtedly the changed code itself... > > > > Could you send the new binaries (dll) here? > ftp://ftp.freepascal.org/fpc/contrib/windows/ > > > See the bug report for dlls; probably best to open a new bug report > requesting the files be uploaded. > > > Uploaded as dblib_current_win32.zip > > > Was compiled with iconv support? Thank you. > > > Yes. Thank you. Regards, Marcos Douglas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Tdbf Memo Field Issue, 2.6.2 vs 2.6.4
On 06/17/2014 07:07 AM, Reinier Olislagers wrote: > Got some questions/remarks/workaround for you in the bug report... > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal Hi Reinier, I've read your notes and questions. I have been told, second hand, that the application is DBase IV, but I will go to the source to confirm this, then report the results in the bug tracker, along with answers to the other questions. Thanks, Dave. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal
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 pascal its not working so is there any workaround for this? You should probably compile the code with -Mtp to switch FPC into (mostly) TP-compatible mode. There are more differences between TP and FPC that you'll encounter otherwise. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Tdbf Memo Field Issue, 2.6.2 vs 2.6.4
Got some questions/remarks/workaround for you in the bug report... ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Illeagal assignment to For Loop variable in Free pascal
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 Free pascal its not working so is there any workaround for this? > > FOR counter := 8 DOWNTO 1 DO > IF filename[counter] = ' 'THEN > DELETE(filename,counter,1) > ELSE > counter := 1; > How about: Counter:= 8; While Counter >= 1 do Begin If Then ... Else Counter:= 1; Counter-= 1; End; ? Perhaps there is a switch that allows assignments to for-loop counters (although I doubt it), I don't know. -- Ewald ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Illeagal assignment to For Loop variable in Free pascal
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 this? FOR counter := 8 DOWNTO 1 DO IF filename[counter] = ' 'THEN DELETE(filename,counter,1) ELSE counter := 1; Thanks Sudarshan -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Illeagal-assignment-to-For-Loop-variable-in-Free-pascal-tp5719603.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Instructions as root in linux
On 17/06/2014 10:23, Rainer Stratmann wrote: > How to do that with automatic password from a freepascal program? e.g. using policykit; see http://wiki.lazarus.freepascal.org/Executing_External_Programs#Redirecting_input_and_output_and_running_under_root ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Instructions as root in linux
How to do that with automatic password from a freepascal program? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal