Closed
Description
At present all compilers are listed in snippet documentation. That's a long list and often snippets have only been tested against a few.
Would it be better to omit the compilers for which the snippet has not been tested from the list?
Here's an example of Snippet documentation / information generated by the Edit | Copy Information menu option:
CloneByteArray
Makes a copy of an array of bytes.
function CloneByteArray(const B: array of Byte): TBytes;
begin
SetLength(Result, Length(B));
if Length(B) > 0 then
Move(B[0], Result[0], Length(B));
end;
Snippet Type:
Routine
Category:
Arrays
Required units:
None.
Required snippets:
TBytes.
See also:
AppendByteArray.
Supported compilers:
Delphi 2 Does not compile
Delphi 3 Does not compile
Delphi 4 Compiles OK
Delphi 5 Compiles OK
Delphi 6 Compiles OK
Delphi 7 Compiles OK
Delphi 2005 Compiles OK
Delphi 2006 Compiles OK
Delphi 2007 Compiles OK
Delphi 2009 Compiles OK
Delphi 2010 Compiles OK
Delphi XE Compiles OK
Delphi XE2 Compiles OK
Delphi XE3 Compiles OK
Delphi XE4 Compiles OK
Delphi XE5 Not tested
Delphi XE6 Not tested
Delphi XE7 Not tested
Delphi XE8 Not tested
Delphi 10 Compiles OK
Delphi 10.1 Not tested
Delphi 10.2 Not tested
Delphi 10.3 Not tested
Delphi 10.4 Not tested
Delphi 11.x Not tested
Delphi 12.x Not tested
Free Pascal Compiles OK
Useful for creating a TBytes array from a constant array or for cloning an
existing byte array.
A snippet from the DelphiDabbler Code Snippets Database
(https://github.com/delphidabbler/codesnip), licensed under the MIT License
(https://opensource.org/licenses/MIT).
The suggestion is to change this to:
CloneByteArray
Makes a copy of an array of bytes.
function CloneByteArray(const B: array of Byte): TBytes;
begin
SetLength(Result, Length(B));
if Length(B) > 0 then
Move(B[0], Result[0], Length(B));
end;
Snippet Type:
Routine
Category:
Arrays
Required units:
None.
Required snippets:
TBytes.
See also:
AppendByteArray.
Tested with the following compilers:
Delphi 2 Does not compile
Delphi 3 Does not compile
Delphi 4 Compiles OK
Delphi 5 Compiles OK
Delphi 6 Compiles OK
Delphi 7 Compiles OK
Delphi 2005 Compiles OK
Delphi 2006 Compiles OK
Delphi 2007 Compiles OK
Delphi 2009 Compiles OK
Delphi 2010 Compiles OK
Delphi XE Compiles OK
Delphi XE2 Compiles OK
Delphi XE3 Compiles OK
Delphi XE4 Compiles OK
Delphi 10 Compiles OK
Free Pascal Compiles OK
Useful for creating a TBytes array from a constant array or for cloning an
existing byte array.
A snippet from the DelphiDabbler Code Snippets Database
(https://github.com/delphidabbler/codesnip), licensed under the MIT License
(https://opensource.org/licenses/MIT).
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Omit untested compilers from generated snippet info
delphidabbler commentedon Oct 23, 2024
Implemented @ commit 45b06d7
2 remaining items