$SetStat: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
(Automatically generated page update)
 
(27 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$SetStat}}
{{DISPLAYTITLE:$SetStat}}
<span class="pageSubtitle"><section begin="desc" />Set local system statistic<section end="desc" /></span>
<span class="pageSubtitle">Set local system statistic</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $SetStat function.</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $SetStat function.</p>


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.  
This function allows a user to set the current value of a local system statistic. There are ten local system statistics that can be set via <var>$SetStat</var>. These stats can be examined via <var>$SyStat</var> under the names <code>LOCAL0</code> through <code>LOCAL9</code>.  


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==
==Syntax==
<p class="syntax"><section begin="syntax" /> %VALUE = $SetStat(stat_num, value)
<p class="syntax"><span class="term">%value</span> = <span class="literal">$SetStat</span>(<span class="term">stat_num</span>, [<span class="term">value</span>])
<section end="syntax" /></p>
<p class="caption">$SetStat Function
</p>
</p>
<p class="caption">%VALUE is set to either 0 or '''value'''.</p>


===Syntax terms===
<table class="syntaxTable">
<tr><th>%value</th>
<td>A variable that is set to <var class="term">value</var>, the new value of the appropriate local statistic, or it is set to 0 if there is an error.</td></tr>
<tr><th>stat_num</th>
<td>The local stat number to be set. If this number is not in the range 0 through 9, <var>$SetStat</var> performs no action and returns a 0. </td></tr>


This function can be used to initialize a local statistic. For example, the code fragment
<tr><th>value</th>
<p class="code"> %VALUE = $SetStat(1)
<td>A number that indicates the value to which the local stat is to be set. This is an optional argument that defaults to 0.</td></tr>
</p>
</table>
initializes local stat number 1 to 0.


==Usage notes==
<ul>
<ul>
<li>[[Sirius $Functions]]
<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>
 
==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<li>[[List of $functions|Sirius functions]]
<li>[[SirMon]]
<li>[[SirMon]]
</ul>
</ul>
<p class="caption">Products authorizing $SetStat
 
</p>


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

Latest revision as of 22:52, 20 September 2018

Set local system statistic

Note: Many $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 ten local system statistics that can be set via $SetStat. These stats can be examined via $SyStat under the names LOCAL0 through LOCAL9.

Syntax

%value = $SetStat(stat_num, [value])

Syntax terms

%value A variable that is set to value, the new value of the appropriate local statistic, or it is set to 0 if there is an error.
stat_num The local stat number to be set. If this number is not in the range 0 through 9, $SetStat performs no action and returns a 0.
value A number that indicates the value to which the local stat is to be set. This is an optional argument that defaults to 0.

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