Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Delphi-News aus aller Welt (https://www.delphipraxis.net/58-delphi-news-aus-aller-welt/)
-   -   Delphi: `procedure RaiseAbstractError(const aClass: TClass; const aMethodName: string (https://www.delphipraxis.net/206081-delphi-%60procedure-raiseabstracterror-const-aclass-tclass%3B-const-amethodname-string.html)

DP News-Robot 17. Nov 2020 17:10

Delphi: `procedure RaiseAbstractError(const aClass: TClass; const aMethodName: string
 
Needs the System.SysConst*unit: procedure RaiseAbstractError(const aClass: TClass; const aMethodName: string); begin * // more explanatory than AbstractErrorProc(); * raise EAbstractError.CreateFmt('%s: method %s.%s', [SAbstractError, aClass.ClassName, aMethodName]); end; It uses a TClass typed parameter so you can call it from non-static class methods (using Self*as parameter value) in addition to instance methods (using ClassType*as parameter value). –jeroen

Weiterlesen...


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:53 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz