Table of Contents

TTMSMCPOptionalAttribute Class

Marks a parameter as optional and supplies the value used when it is omitted.

API unit family: TMS.MCP.Attributes Inherits from: TTMSMCPCustomAttribute Implements: ITMSMCPOptionalAttribute

Syntax

TTMSMCPOptionalAttribute = class(TTMSMCPCustomAttribute, ITMSMCPOptionalAttribute)

Remarks

Every parameter is published as required until this attribute is applied. Delphi default parameter values are not visible through RTTI, so the fallback has to be repeated here: write [TTMSMCPOptionalAttribute(100)] in front of a parameter declared as ACount: Integer = 100. When the caller omits the argument the stored value is passed to the method; when the parameterless constructor is used an empty value is passed.

Properties

Name Description
Value Value passed to the method when the caller omits the argument.

Used by