CnPack Forum


 
Subject: D2009 : Replace in file function will mess up code - Critical
swierzbicki
新警察
Rank: 1



UID 41816
Digest Posts 0
Credits 20
Posts 7
点点分 20
Reading Access 10
Registered 2009-2-18
Status Offline
Post at 2009-2-18 06:24  Profile | Blog | P.M. 
D2009 : Replace in file function will mess up code - Critical

Hi,

When using the Replace in file function in D2009, all impacted files will be totally messed up !
Example:Create a new vcl application and don't save it

This will generate something like that (I'm using a French version of Delphi, see remarks with accentuated characters):

unit Unit2;



interface



uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

  Dialogs;



type

  TForm2 = class(TForm)

  private

    { Déclarations privées }

  public

    { Déclarations publiques }

  end;



var

  Form2: TForm2;



implementation



{$R *.dfm}



end.

Now, in the CNPack menu choose "Replace in file" function
In "search for" add Déclarations
In "Replace with" add Dèclarations
In range select "Files in project group(2)"

Click Replace and validate by hitting the Yes button
Notice that you will get an error message telling you that the dproj file doesn't exists (well, that's normal since my project wasn't saved)and asking you to continue. Select yes.

You will get now a dialog box telling you that the replacement was completed on : 1 file, 2 replacements

The unit code is now totally messed and will look like :

unit Unit2;



interface



uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

  Dialogs;



type

  TForm2 = class(TForm)

  private

    { D

Note that it stopped at the accentuated character 'è'. I guess you have issue with Unicode data.
Note also that CTRL-Z (undo) isn't working so it is impossible to get its old code !

This is a critical issue.

BR

Stephan

[ Last edited by  swierzbicki at 2009-2-18 15:39 ]
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2009-2-18 10:12  Profile | Blog | P.M. 
Thanks for your report. We'll check this problem.
Top
swierzbicki
新警察
Rank: 1



UID 41816
Digest Posts 0
Credits 20
Posts 7
点点分 20
Reading Access 10
Registered 2009-2-18
Status Offline
Post at 2009-2-18 15:41  Profile | Blog | P.M. 
Thank you passion, I will wait for future nightly build
Thank you again for providing us with such a great tool !
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2009-2-18 21:05  Profile | Blog | P.M. 
It's a Unicode String problem in Delphi 2009. Now we fixed it.
Please try the latest 0.9.1.484 nightly build?
Top
swierzbicki
新警察
Rank: 1



UID 41816
Digest Posts 0
Credits 20
Posts 7
点点分 20
Reading Access 10
Registered 2009-2-18
Status Offline
Post at 2009-2-19 05:11  Profile | Blog | P.M. 
Wooow, you are really fast at code fixing !
Looks like the new nightly build is well working.

Thank you
Top
 




All times are GMT++8, the time now is 2024-11-22 04:49

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.008156 second(s), 9 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP