ParamReturnsRaisesTag

Michalis Kamburelis edited this page Jan 8, 2017 · 6 revisions
Clone this wiki locally

PasDoc supports three tags for describing functions: @param, @returns and @raises.

  • @param marks the description of a function’s parameter

  • @returns marks the description of a function’s result value

  • @raises marks the description of an exception raised inside a function

Examples:

{ Do something with name and value.
  @param(Name is a string with the item's name)
  @param(Value is a string with the item's value)
  @returns(@true on success, @false otherwise)
  @raises(EUnknownItem if the name can not be found) }
function DoSomething(const Name: string; const Value: string): boolean;

Note that PasDoc (currently!) does not check whether the parameter names in the description match those of the function. But please don’t depend on it — a future version may check it.