wuwuxin 28 Posted November 19, 2021 For System.SysUtils.TStringHelper, I have to need to add some additional methods - is it possible to extend or "inherit" an existing class/record helper to add user-specified methods? Share this post Link to post
David Heffernan 2345 Posted November 19, 2021 (edited) 17 minutes ago, wuwuxin said: is it possible to extend or "inherit" an existing class/record helper to add user-specified methods? No. Longstanding limitation. Kinda sucks. Can't have multiple helpers which would be another way to do what you want. Edited November 19, 2021 by David Heffernan 1 Share this post Link to post
Uwe Raabe 2057 Posted November 19, 2021 While the above is valid for record helpers, it is indeed possible to extend class helpers. (It es even documented: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Class_and_Record_Helpers_(Delphi)#Helper_Syntax) In this example we extend the existing class helper TRESTRequestParameterHelper from REST.Client.pas (Delphi 11) with another method without hiding the ContentType member of TRESTRequestParameterHelper. type TMyRESTRequestParameterHelper = class helper (TRESTRequestParameterHelper) for TRESTRequestParameter procedure MyTest; end; 4 Share this post Link to post