Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
Compiler
Delphi
Anonymous Methods
BASM
Code Generation/Optimization
Error Recovery
Errors - Warnings
Exceptions
Execution
Finalization
Generics
Header Generation
Interaction with UI
Interfaces
Language
Default Parameters
Dynamic Arrays
Overloading
Variants
Linker
Make Logic
Memory Manager
OBJ Generation
OBJ Support
Other Compiler
Packages
RTTI
String Resources
TD Debug Info
Thread Local Storage
Version resilience
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/Compiler/Delphi/Language
[ Add a report in this area ]
Report #:
104907
Status:
Open
Extent Arrays with methods the same was Record was.
Project:
Delphi
Build #:
16.0.4429.46931
Version:
16.4
Submitted By:
David Tetard
Report Type:
New Feature Request
Date Reported:
4/14/2012 11:25:19 PM
Severity:
Infrequently encountered problem
Last Updated:
8/6/2012 12:54:58 PM
Platform:
All platforms
Internal Tracking #:
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:
20
Description
IMHO, the biggest improvement to records in recent years was the addition of methods.
I suggest that possibility for developers to define methods for arrays could be added too to great adavantage, especially open arrays.
I can easily see the following be used in numerous units in my apps:
Type
TMyArray : Array Of Integer
Function Add : Integer;
Procedure Clear;
End;
Procedure TMyArray.Clear;
Begin
SetLength(Self, 0);
End;
Function TMyArray.Add : Integer;
Begin
...
End;
Var
MyArray : TMyArray;
Index : Integer;
Begin
MyArray.Clear;
Index := MyArray.Add;
MyArray[Index] := 1;
...
End;
Steps to Reproduce:
None
Workarounds
None
Attachment
None
Comments
Alexey Ponomarev at 4/19/2012 10:29:59 PM
-
Agree,
Another great improvement would be to introduce helpers for all types including integers, arrays, interfaces, floats, whatever you want, and not only for classes and records.
E.g.
TIntToStringHelper = class helper for integer
public
function ToString: string; inline;
end;
function TIntToStringHelper.ToString: string;
begin
result := IntToStr(self);
end;
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