$Bump: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 11: Line 11:


The second argument is an optional userid. If this argument is provided, the user number indicated by argument one will only be bumped if the userid matches the second argument. This helps prevent accidentally bumping a user that just logged onto a thread previously occupied by another user.
The second argument is an optional userid. If this argument is provided, the user number indicated by argument one will only be bumped if the userid matches the second argument. This helps prevent accidentally bumping a user that just logged onto a thread previously occupied by another user.
==Syntax==
==Syntax==
<p class="syntax"><span class="term">%result</span> = <span class="literal">$Bump</span>(<span class="term">user_num</span>, [<span class="term">userid</span>])
<p class="syntax"><span class="term">%result</span> = <span class="literal">$Bump</span>(<span class="term">user_num</span>, [<span class="term">userid</span>])
Line 18: Line 19:
<var class="term">%result</var> is set to indicate the success of the function.</p>
<var class="term">%result</var> is set to indicate the success of the function.</p>


===Return codes===
<p class="code">0 - User bumped
1 - User not found
2 - Not privileged to issue BUMP command
</p>
==Usage notes==
The behavior of <var>$Bump</var> is affected by the FUNCOPTS system parameter: If the FUNCOPTS X'01' bit is set, a caller of <var>$Bump</var> can bump any thread that has the same user ID as that of the caller, whether or not the caller is a system administrator or system manager.
The behavior of <var>$Bump</var> is affected by the FUNCOPTS system parameter: If the FUNCOPTS X'01' bit is set, a caller of <var>$Bump</var> can bump any thread that has the same user ID as that of the caller, whether or not the caller is a system administrator or system manager.
<p class="code"> 0 - User bumped
1 - User not found
2 - Not privileged to issue BUMP command
</p>
<p class="caption">$Bump return codes
</p>


==Example==
==Example==
Line 34: Line 35:
END
END
</p>
</p>
<p class="code">


[[Category:$Functions|$Bump]]
[[Category:$Functions|$Bump]]

Revision as of 17:57, 30 August 2013

Bump a user

Note: Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currrently no OO equivalent for the $Bump function as we have yet to implement a User Class.

The $Bump function allows a privileged user (system manager or system administrator) to bump another user as with the BUMP command.

$Bump accepts one or two arguments and returns a numeric code.

The first argument is the number of the user to be bumped.

The second argument is an optional userid. If this argument is provided, the user number indicated by argument one will only be bumped if the userid matches the second argument. This helps prevent accidentally bumping a user that just logged onto a thread previously occupied by another user.

Syntax

%result = $Bump(user_num, [userid])

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

Return codes

0 - User bumped 1 - User not found 2 - Not privileged to issue BUMP command

Usage notes

The behavior of $Bump is affected by the FUNCOPTS system parameter: If the FUNCOPTS X'01' bit is set, a caller of $Bump can bump any thread that has the same user ID as that of the caller, whether or not the caller is a system administrator or system manager.

Example

The following program bumps userid 'HOMER' with user number 13.

B %RC = $Bump( 13, 'HOMER' ) END