< Dice‎ | MacroContext
Revision as of 18:27, 27 April 2017 by Skizzerz (talk | contribs) (Created page with "{{APIdoc|MacroContext.Param Property}} Gets the parameter passed to the macro. {{ns}} == Syntax == <syntaxhighlight lang="C#"> public string Param { get; private set; } </sy...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MacroContext.Param Property

From DiceRoller Documentation

Gets the parameter passed to the macro.

  • Namespace: Dice
  • Assembly: DiceRoller (in DiceRoller.dll)

Syntax

public string Param { get; private set; }

Property Value

Type: System.String

The parameter passed to the macro. The callback is responsible for parsing this into something useful and acting accordingly.

Remarks

All leading and trailing whitespace is trimmed from Param, so the macro [ a ] and the macro [a] have equivalent Params ("a"). The full string from the macro is passed into Param, no additional parsing is performed. It is up to the macro callback to parse Param into something useful.

A recommended method is to separate macro arguments via the colon character, for example [a:b:c] would execute a macro named "a" with "b" and "c" as the two arguments passed into it. However, you are free to use whatever method you wish.