CnPack Forum » CnWizards IDE Wizards » D2009 : Replace in file function will mess up code - Critical


2009-2-18 06:24 swierzbicki
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):

[code]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.[/code]

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 :

[code]unit Unit2;



interface



uses

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

  Dialogs;



type

  TForm2 = class(TForm)

  private

    { D[/code]

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

[[i] Last edited by  swierzbicki at 2009-2-18 15:39 [/i]]

2009-2-18 10:12 Passion
Thanks for your report. We'll check this problem.

2009-2-18 15:41 swierzbicki
Thank you passion, I will wait for future nightly build :)
Thank you again for providing us with such a great tool !

2009-2-18 21:05 Passion
It's a Unicode String problem in Delphi 2009. Now we fixed it.
Please try the latest 0.9.1.484 nightly build?

2009-2-19 05:11 swierzbicki
Wooow, you are really fast at code fixing !
Looks like the new nightly build is well working.

Thank you

页: [1]


Powered by Discuz! Archiver 5.0.0  © 2001-2006 Comsenz Inc.