<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://159.203.101.162/w/index.php?action=history&amp;feed=atom&amp;title=FUNCTION_%26_VALUE_6.08</id>
	<title>FUNCTION &amp; VALUE 6.08 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://159.203.101.162/w/index.php?action=history&amp;feed=atom&amp;title=FUNCTION_%26_VALUE_6.08"/>
	<link rel="alternate" type="text/html" href="http://159.203.101.162/w/index.php?title=FUNCTION_%26_VALUE_6.08&amp;action=history"/>
	<updated>2026-05-13T18:35:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>http://159.203.101.162/w/index.php?title=FUNCTION_%26_VALUE_6.08&amp;diff=4180&amp;oldid=prev</id>
		<title>Tom Parker at 01:48, 25 January 2018</title>
		<link rel="alternate" type="text/html" href="http://159.203.101.162/w/index.php?title=FUNCTION_%26_VALUE_6.08&amp;diff=4180&amp;oldid=prev"/>
		<updated>2018-01-25T01:48:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 01:48, 25 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=Deprecated=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Please see [[Setting up the new Formula System]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==FUNCTION &amp;amp; VALUE==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==FUNCTION &amp;amp; VALUE==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tom Parker</name></author>
		
	</entry>
	<entry>
		<id>http://159.203.101.162/w/index.php?title=FUNCTION_%26_VALUE_6.08&amp;diff=4097&amp;oldid=prev</id>
		<title>LegacyKing: Created page with &quot;==FUNCTION &amp; VALUE==   ====RAW====    ${pc.val.x}  (again, where the &quot;x&quot; is the new variable now holding new FACE).   2 new tokens for the Data Control file:    FUNCTION:x...&quot;</title>
		<link rel="alternate" type="text/html" href="http://159.203.101.162/w/index.php?title=FUNCTION_%26_VALUE_6.08&amp;diff=4097&amp;oldid=prev"/>
		<updated>2018-01-07T00:10:02Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==FUNCTION &amp;amp; VALUE==   ====RAW====    ${pc.val.x}  (again, where the &amp;quot;x&amp;quot; is the new variable now holding new FACE).   2 new tokens for the Data Control file:    FUNCTION:x...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==FUNCTION &amp;amp; VALUE==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====RAW====&lt;br /&gt;
   ${pc.val.x}&lt;br /&gt;
&lt;br /&gt;
(again, where the &amp;quot;x&amp;quot; is the new variable now holding new FACE).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2 new tokens for the Data Control file:&lt;br /&gt;
   FUNCTION:x&lt;br /&gt;
   VALUE:x&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   FUNCTION:x&lt;br /&gt;
Must appear as the first item on the line in a data control file&lt;br /&gt;
Takes one argument, a function name&lt;br /&gt;
Must be a &amp;quot;legal&amp;quot; function name, meaning:&lt;br /&gt;
- starts with a letter, e.g. A-Z, additional legal characters are 0-9 and _ (none of those as the first character)&lt;br /&gt;
- No spaces, no other special characters.&lt;br /&gt;
- Are case insensitive (as many other things in LST files)&lt;br /&gt;
&lt;br /&gt;
This defines the function name as it will be used in a formula in the LST data files.&lt;br /&gt;
If a FUNCTION appears more than once, the other characteristics (currently VALUE) must be identical.&lt;br /&gt;
&lt;br /&gt;
   VALUE:x&lt;br /&gt;
Must appear as an additional token on the line of a FUNCTION: in the data control file&lt;br /&gt;
&lt;br /&gt;
The provided value must be a value formula.  This means it must have&lt;br /&gt;
valid variable names, valid function names, matching parenthesis, etc. etc.&lt;br /&gt;
In addition to all of the build-in functions (e.g. if, ceil, round), two&lt;br /&gt;
additional items can be used:&lt;br /&gt;
&lt;br /&gt;
(1) the arg(n) function.  The arg function is a &amp;quot;local&amp;quot; function to the VALUE: part of a FUNCTION (it can not generally be used in LST files).&lt;br /&gt;
The arg function takes one argument.  It MUST be a Integer &amp;gt;= 0.&lt;br /&gt;
&lt;br /&gt;
(2) Any previously defined FUNCTION. This MUST appear in the file before&lt;br /&gt;
the current Function or in a file processed before the current file.&lt;br /&gt;
&lt;br /&gt;
Meaning:&lt;br /&gt;
   FUNCTION:d20mod &amp;lt;&amp;gt; VALUE:floor((arg(0)-10)/2)&lt;br /&gt;
   FUNCTION:embed &amp;lt;&amp;gt; VALUE:d20mod(arg(0)*4&lt;br /&gt;
is legal, while:&lt;br /&gt;
   FUNCTION:embed &amp;lt;&amp;gt; VALUE:d20mod(arg(0)*4&lt;br /&gt;
   FUNCTION:d20mod &amp;lt;&amp;gt; VALUE:floor((arg(0)-10)/2)&lt;br /&gt;
...is not legal (since d20mod does not yet exist when embed is encountered)&lt;br /&gt;
&lt;br /&gt;
When a function is used in LST data, it is called by the name provided&lt;br /&gt;
in the FUNCTION token.  It requires a certain number of arguments.  This&lt;br /&gt;
exactly matches the integer one greater than the highest number of the&lt;br /&gt;
arg(n) function provided in the VALUE part of a FUNCTION (In computer science terms, the arg(n) function is zero-indexed)&lt;br /&gt;
The provided arguments can be any legal formula, so:&lt;br /&gt;
   d20Mod(INT)&lt;br /&gt;
   d20Mod(INT+4)&lt;br /&gt;
are both perfectly legal.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
   FUNCTION:d20Mod &amp;lt;&amp;gt; VALUE:floor((arg(0)-10)/2)&lt;br /&gt;
Note the arg(n) function here uses ZERO, not ONE.&lt;br /&gt;
&lt;br /&gt;
This would then be used in LST data as:&lt;br /&gt;
   d20Mod(n)&lt;br /&gt;
It will catch both d20Mod() and d20Mod(14,5) as errors (too few or too&lt;br /&gt;
many args).  It would also catch: d20Mod(&amp;quot;mystring&amp;quot;) as an error (wrong&lt;br /&gt;
format - requires a Number, found a String).&lt;br /&gt;
The n is substituted where &amp;quot;arg(0)&amp;quot; appears in the &amp;quot;VALUE&amp;quot;... so a&lt;br /&gt;
statmod would be as easy as:&lt;br /&gt;
   d20Mod(INT)&lt;br /&gt;
or some such...&lt;br /&gt;
Direct values can also be used, e.g. d20Mod(10) would return 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some other notes:&lt;br /&gt;
&lt;br /&gt;
Note that the function actually has to be *used* (not just defined) for&lt;br /&gt;
the errors to be caught (since it can't guess at overall context)&lt;br /&gt;
&lt;br /&gt;
An embedding example can be found here:&lt;br /&gt;
https://groups.yahoo.com/neo/groups/pcgen_experimental/conversations/messages/19549&lt;/div&gt;</summary>
		<author><name>LegacyKing</name></author>
		
	</entry>
</feed>