Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
3rdRail
Blackfish SQL
C#Builder
C++BuilderX
CodeCentral
Conference
DBArtisan
Delphi for PHP
Delphi Prism
Delphi-BCB
EDN
InterBase
JBuilder
JBuilder 2007
Kylix
Optimizeit
QualityCentral
Test project
You are not logged in.
Help
Print
Public Report
Report From:
[ Add a report in this area ]
Report #:
8372
Status:
Reported
Format on short strings erroneous
Project:
Build #:
7.1.1523.17956
Version:
8.0
Submitted By:
Guido Weber
Report Type:
Basic functionality failure
Date Reported:
6/8/2004 11:35:49 PM
Severity:
Commonly encountered problem
Last Updated:
Platform:
All versions
Internal Tracking #:
Resolution:
None
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
5.00 out of 5
Total Votes:
1
Description
The output of SysUtils.Format on short strings differs, depending on whether the short string is declared as a named type or not. If no type is declared, Format writes 'System.Byte[]' as value for the string.
Steps to Reproduce:
Put a memo and a button on a Form, then insert the following code:
type
string4t = string[4];
procedure TForm1.Button3Click(Sender: TObject);
var
s1 : string4t;
s2 : string[4];
procedure doit(cnt : integer);
var
sl : TStrings;
si : string;
begin
sl := Memo1.Lines;
si := IntToStr(cnt);
sl.Add(Format(si + 'a: "%s" - "%s"', [s1, s2]));
sl.Add(Format(si + 'b: "%s" - "%s"', [string(s1), string(s2)]));
sl.Add(si + 'c: "' + s1 + '" - "' + s2 + '"');
sl.Add(System.String.Format(si + 'd: "{0}" - "{1}"', s1, s2));
end;
begin
s1 := '';
s2 := '';
doit(1);
s1 := 'a';
s2 := 'b';
doit(2);
s1 := System.String.Concat('asd', 'fgh');
s2 := System.String.Concat('qwer', 'tz');
doit(3);
end;
Workarounds
None
Attachment
None
Comments
None
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us