<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://skizzerz.net/DiceRoller/index.php?action=history&amp;feed=atom&amp;title=Dice%2FFunctionContext%2FExpression</id>
	<title>Dice/FunctionContext/Expression - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://skizzerz.net/DiceRoller/index.php?action=history&amp;feed=atom&amp;title=Dice%2FFunctionContext%2FExpression"/>
	<link rel="alternate" type="text/html" href="https://skizzerz.net/DiceRoller/index.php?title=Dice/FunctionContext/Expression&amp;action=history"/>
	<updated>2026-04-05T18:23:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://skizzerz.net/DiceRoller/index.php?title=Dice/FunctionContext/Expression&amp;diff=744&amp;oldid=prev</id>
		<title>Skizzerz: Created page with &quot;{{APIdoc|FunctionContext.Expression Property}} Gets the dice expression this function is attached to, or null if it is a global function.  {{ns}}  == Syntax == &lt;syntaxhighligh...&quot;</title>
		<link rel="alternate" type="text/html" href="https://skizzerz.net/DiceRoller/index.php?title=Dice/FunctionContext/Expression&amp;diff=744&amp;oldid=prev"/>
		<updated>2017-04-25T22:11:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{APIdoc|FunctionContext.Expression Property}} Gets the dice expression this function is attached to, or null if it is a global function.  {{ns}}  == Syntax == &amp;lt;syntaxhighligh...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{APIdoc|FunctionContext.Expression Property}}&lt;br /&gt;
Gets the dice expression this function is attached to, or null if it is a global function.&lt;br /&gt;
&lt;br /&gt;
{{ns}}&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C#&amp;quot;&amp;gt;&lt;br /&gt;
public DiceAST Expression { get; internal set; }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Property Value ===&lt;br /&gt;
Type: [[Dice/AST/DiceAST|Dice.AST.DiceAST]]&lt;br /&gt;
&lt;br /&gt;
The dice expression this function is attached to, or {{cs|null}} if it is a global function.&lt;br /&gt;
&lt;br /&gt;
== Remarks ==&lt;br /&gt;
Roll functions will typically look at and perform some transformation on Expression.Value, Expression.ValueType, and Expression.Values (setting the FunctionContext's Value, ValueType, and Values to the modified versions).&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
The following example adds one to a roll.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C#&amp;quot;&amp;gt;&lt;br /&gt;
using Dice;&lt;br /&gt;
&lt;br /&gt;
class Sample&lt;br /&gt;
{&lt;br /&gt;
    public static void Main()&lt;br /&gt;
    {&lt;br /&gt;
        Roller.DefaultConfig.FunctionRegistry.RegisterFunction(&amp;quot;addOne&amp;quot;, AddOne, FunctionScope.Roll);&lt;br /&gt;
        Roller.Roll(&amp;quot;4d6dl1.addOne()&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static void AddOne(FunctionContext context)&lt;br /&gt;
    {&lt;br /&gt;
        // Expression is the KeepNode representing the &amp;quot;dl1&amp;quot; extra&lt;br /&gt;
        context.Value = Expression.Value + 1;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skizzerz</name></author>
		
	</entry>
</feed>