$SetStat: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
Line 12: Line 12:
The second argument is a number that indicates the value to which the local stat is to be set. This is an optional argument and defaults to 0.
The second argument is a number that indicates the value to which the local stat is to be set. This is an optional argument and defaults to 0.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%VALUE = $SetStat(stat_num, value)
<p class="syntax"><section begin="syntax" />%value = $SetStat(stat_num, value)
<section end="syntax" /></p>
<section end="syntax" /></p>
<p>
</p>
<p>%VALUE is set to either 0 or '''value'''.</p>


<p>%value is set to either 0 or to <var class="term">value</var>.</p>


This function can be used to initialize a local statistic. For example, the code fragment
 
<p class="code"> %VALUE = $SetStat(1)
==Usage notes==
</p>
<ul>
initializes local stat number 1 to 0.
<li>This function can be used to initialize a local statistic. For example, this code fragment initializes local stat number 1 to 0:
<p class="code">%value = $SetStat(1)</p>
</ul>


<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList">
<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList">
Line 28: Line 28:
<li>[[SirMon]]
<li>[[SirMon]]
</ul>
</ul>
<p>
 
</p>


[[Category:$Functions|$SetStat]]
[[Category:$Functions|$SetStat]]

Revision as of 22:22, 26 October 2012

Set local system statistic

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $SetStat function.

This function allows a user to set the current value of a local system statistic. There are 10 local system statistics that can be set via $SetStat. These stats can be examined via $SyStat under the names LOCAL0 through LOCAL9.

The $SetStat function accepts two arguments and returns either the new value of the appropriate local statistic or a 0 if there is an error.

The first argument is the local stat number to be set. This number must be 0 through 9 or the $SetStat performs no action and returns a 0.

The second argument is a number that indicates the value to which the local stat is to be set. This is an optional argument and defaults to 0.

Syntax

<section begin="syntax" />%value = $SetStat(stat_num, value) <section end="syntax" />

%value is set to either 0 or to value.


Usage notes

  • This function can be used to initialize a local statistic. For example, this code fragment initializes local stat number 1 to 0:

    %value = $SetStat(1)

Products authorizing $SetStat