Skip to content

Omit untested compilers from snippet documentation #143

Closed
@delphidabbler

Description

@delphidabbler

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).

Activity

added
acceptedAccepted for implementation / fixing
and removed
consideringIssue under consideration. May be accepted or rejected
on Oct 23, 2024
moved this from Considering to Accepted in CodeSnipon Oct 23, 2024
added a commit that references this issue on Oct 23, 2024
45b06d7
delphidabbler

delphidabbler commented on Oct 23, 2024

@delphidabbler
OwnerAuthor

Implemented @ commit 45b06d7

added
completedWork has been completed on this issue and changes have been committed to `develop` branch..
and removed
acceptedAccepted for implementation / fixing
on Oct 23, 2024
moved this from Accepted to Done - awaiting release in CodeSnipon Oct 23, 2024

2 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

completedWork has been completed on this issue and changes have been committed to `develop` branch..feature requestRequest for a new feature

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @delphidabbler

      Issue actions

        Omit untested compilers from snippet documentation · Issue #143 · delphidabbler/codesnip