$Priorty: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(19 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Change a user's priority</span>
<span class="pageSubtitle">Change a user's priority</span>


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


The <var>$Priorty</var> function allows a privileged user (system manager or system administrator) to change another user's priority.  
The <var>$Priorty</var> function allows a privileged user (system manager or system administrator) to change another user's priority.  
Line 19: Line 19:


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /><span class="term">%result </span><span class="literal">= $Priorty ( </span><span class="term">user_num, userid, min, max</span><span class="literal">)</span>
<p class="syntax"><span class="term">%result </span><span class="literal">= $Priorty ( </span><span class="term">user_num</span>, [<span class="term">userid</span>], <span class="term">min</span>, [<span class="term">max</span>]<span class="literal">)</span>
<section end="syntax" /></p>
</p>


Where <var class="term">%result</var> is set to indicate the success of the function.
Where <var class="term">%result</var> is set to indicate the success of the function.


<p class="code">  
===Return codes===
0 - Priority changed
<p class="code">0 - Priority changed
1 - User not found
1 - User not found
2 - Not privileged to issue PRIORITY command
2 - Not privileged to issue PRIORITY command
3 - Invalid priority specified
3 - Invalid priority specified
</p>
<p class="caption">$Priorty return codes
</p>
</p>


<var>$Priorty</var> gives you more flexibility in the priorities you can assign to a user than does the <var>PRIORITY</var> command. The valid priorities with the <var>PRIORITY</var> command and their corresponding minimum and maximum priority values are:
==Usage notes==
<ul>
<li><var>$Priorty</var> gives you more flexibility in the priorities you can assign to a user than does the <var>PRIORITY</var> command. The valid priorities with the <var>PRIORITY</var> command and their corresponding minimum and maximum priority values are:


<table>
<table>
<tr><th>LOW</th><td>0 and 47</td></tr>  
<tr><th><var>LOW</var></th><td>0 and 47</td></tr>  
<tr><th>STANDARD</th><td>32 and 79</td></tr>  
<tr><th><var>STANDARD</var></th><td>32 and 79</td></tr>  
<tr><th>HIGH</th><td>80 and 127</td></tr>
<tr><th><var>HIGH</var></th><td>80 and 127</td></tr>
</table>
</table>


The current priority of a user whose priority is reset via <var>$Priorty</var> is set to
<li>The current priority of a user whose priority is reset via <var>$Priorty</var> is set to
<p class="code">( ( 2 * min_priority ) + max_priority ) / 3
<p class="code">( ( 2 * min_priority ) + max_priority ) / 3
</p>
</p>
</ul>


==Example==
The following program sets user 0 to low priority.<p class="code">B
The following program sets user 0 to low priority.<p class="code">B
%rc = $priorty( 0, , 0)
%rc = $priorty( 0, , 0)
Line 50: Line 52:
</p>
</p>


==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]
<li>[[List of $functions|Sirius functions]]
</ul>
</ul>
<p class="caption">Products authorizing $Priorty
</p>


[[Category:$Functions|$Priorty]]
[[Category:$Functions|$Priorty]]

Latest revision as of 22:52, 20 September 2018

Change a user's priority

Note: Many $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $Priorty function.

The $Priorty function allows a privileged user (system manager or system administrator) to change another user's priority.

Note: As of Sirius Mods Version 7.3, you can open access to $Priorty beyond system managers or system administrators by specifying the FUNCOPTS system parameter X'40' or X'20' bit settings.

The $Priorty function accepts four arguments and returns a numeric code.

The first argument is the number of the user whose priority is to be changed.

The second argument is an optional userid. If this argument is provided, the user number indicated by argument one will only have its priority changed if the userid matches the second argument. This prevents accidentally changing the priority of a user that just logged onto a thread previously occupied by another user.

The third argument is a number indicating the user's new minimum priority. This is a required argument and must be between 0 and 111.

The fourth argument is a number indicating the user's new maximum priority. This is an optional argument and must be between the minimum priority (argument 3) plus 16 and 127. The default for this argument is the minimum priority plus 47.

Syntax

%result = $Priorty ( user_num, [userid], min, [max])

Where %result is set to indicate the success of the function.

Return codes

0 - Priority changed 1 - User not found 2 - Not privileged to issue PRIORITY command 3 - Invalid priority specified

Usage notes

  • $Priorty gives you more flexibility in the priorities you can assign to a user than does the PRIORITY command. The valid priorities with the PRIORITY command and their corresponding minimum and maximum priority values are:
    LOW0 and 47
    STANDARD32 and 79
    HIGH80 and 127
  • The current priority of a user whose priority is reset via $Priorty is set to

    ( ( 2 * min_priority ) + max_priority ) / 3

Example

The following program sets user 0 to low priority.

B %rc = $priorty( 0, , 0) End

Products authorizing $Priorty