Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Refactoring/Extract Method    [ Add a report in this area ]  
Report #:  68346   Status: Closed
Extract Method Source code Loss
Project:  Delphi Build #:  16989
Version:    12.0 Submitted By:   Paul van der Ven
Report Type:  Crash / Data loss / Total failure Date Reported:  10/28/2008 7:15:37 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   266230
Resolution: Duplicate (Resolution Comments) Resolved in Build: : 11.0.2902.10471
Duplicate of:  40710
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
  if FQuoteChar = #0 then
  begin
    beep;
  end;

will become:

  if FQuoteChar =
Steps to Reproduce:
select code
Extract Method
Workarounds
if FQuoteChar = #110 then
  begin
    beep;
  end;

will become:

  if FQuoteChar = 'n' then
  begin
    beep;
  end;

replace 'n' to #0
Attachment
None
Comments

Markus Humm at 10/29/2008 5:00:32 AM -
So ou're claiming that the # sign spoils the extract method refactoring? Am I right?

Igor Gottwald at 1/8/2009 6:42:25 AM -
It looks like Extract Method refactoring tries to evaluate string expressions.
#0 terminates extracted code
#9, #10 and #13 are double quoted (''#9'', ''#10'', ''#13'') but the functionality is OK.
All other values seem to work, but #1 .. #31 except values above are stored in the source code as strings. It can produce serius problems with other tools or later in programming.
Tested in Delphi 12.1

Server Response from: ETNACODE01