Recent

Author Topic: is there a backware compatablity 9.30 => 9.28.2 setting?  (Read 6938 times)

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
is there a backware compatablity 9.30 => 9.28.2 setting?
« on: May 16, 2011, 07:27:36 pm »
I wish to start using the latest rev but there are several issues the new release does not like about code I generated with rev 9.28.2.
A few being I can not longer use
 inc(compontX.Tag);

and the order of variables and procedures in the object's type def (variables must come before procedures).

Is there a flag or setting I can use on the (100+) older projects so I can use the latest release and still support these older projects while I transition over?
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: is there a backware compatablity 9.30 => 9.28.2 setting?
« Reply #1 on: May 16, 2011, 07:47:48 pm »
Both changes where introduced in fpc 2.4 .0

http://wiki.lazarus.freepascal.org/User_Changes_2.4.0#Order_of_field_and_method.2Fproperty_declarations
http://wiki.lazarus.freepascal.org/User_Changes_2.4.0#Treating_direct-mapped_properties_as_regular_fields

You can try to install an older fpc version. But I do not know if it will work.
In order to compile your projects with the older fpc, you will need to compile at least the LCL (and all packages used by your project with the older fpc).
I do not know if the current LCL can still be compiled with this

-----
As for
 inc(compontX.Tag);
That can be fixed by search and replace using regular expression searches
search for:
  inc\((.+?)\);
replace with
  $1 := $1 + 1;

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
Re: is there a backware compatablity 9.30 => 9.28.2 setting?
« Reply #2 on: May 16, 2011, 07:54:20 pm »
...
As for
 inc(compontX.Tag);
That can be fixed by search and replace using regular expression searches
search for:
  inc\((.+?)\);
replace with
  $1 := $1 + 1;

Thank you!  this will speed up my update task a lot!
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: is there a backware compatablity 9.30 => 9.28.2 setting?
« Reply #3 on: May 16, 2011, 08:45:07 pm »
if you have
inc(a,2)

then try search for:
  inc\((.+?),(.+?)\);
replace with
  $1 := $1 + $2;


for the order of declarations in classes. Instead of re-ordering everything, it may be faster to add additional "public", "private", ... lines

 

TinyPortal © 2005-2018