0

The default record-helpers doesn't have that I want.

I relize my own record-helper in example for string:

type
  TArhStringHelper = record helper for
    string
    procedure ReplaceAll(aOldValue: string; aNewValue: string);
    procedure ReplaceTags(aUser: TUser);
    procedure ReplaceTagCounter(aInt: Integer);
    function FromRouterTime: string;
  end;

I found the bug in that. My record-helper overrides the default TStringHelper declarated in SysUtils, and I can't use and see it methods.

Then I rewrite record-helper for TStringHelper, but results are the same.

type
  TArhStringHelper = record helper for
    TStringHelper
    procedure ReplaceAll(aOldValue: string; aNewValue: string);
    procedure ReplaceTags(aUser: TUser);
    procedure ReplaceTagCounter(aInt: Integer);
    function FromRouterTime: string;
  end;

It's possible to inherite record-helper?

Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
Alexandr
  • 338
  • 1
  • 4
  • 16
  • 2
    No, and this was asked a couple of days before – Sir Rufo Aug 06 '13 at 09:12
  • @SirRufo Thanks, but the documentation shows declaration: "type identifierName = class|record helper [(ancestor list)] for TypeIdentifierName". Can you show me, how to implement helpers with ancestor list? I trying that: "type T1 = record helper [TStringHelper] for string" and got the syntax error. Why that? Also: how to write comments here with line breaks? – Alexandr Aug 06 '13 at 09:44
  • 1
    As is stated in the answer to the duplicate, record helpers do not support inheritance. Inheritance is only available for class helpers. – David Heffernan Aug 06 '13 at 09:50
  • 1
    @DavidHeffernan Just had an eye on your [QC-Report](http://qc.embarcadero.com/wc/qcmain.aspx?d=107781) :o) – Sir Rufo Aug 06 '13 at 10:16

0 Answers0