Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/Format + Float    [ Add a report in this area ]  
Report #:  102398   Status: Open
XE2 incompatibility of function Format when used with variants with earlier Delphi versions
Project:  Delphi Build #:  16.0.4358.45540
Version:    16.3 Submitted By:   Kiriakos Vlahos
Report Type:  Minor failure / Design problem Date Reported:  1/6/2012 9:54:49 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   289110
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 1
Description
None
Steps to Reproduce:
The code below produces an error in XE2.  It used to work with earlier Delphi versions.  The new Format function should try and cast the variant to the required type.   This is a problem with custom variants as well.

procedure TForm2.Button3Click(Sender: TObject);
Var
  V : Variant;
begin
  V := 3;
  ShowMessage(Format('%s', [V]));
end;

Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01