$SirWarn: Difference between revisions
m (1 revision) |
m (misc cleanup) |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
<span class="pageSubtitle">Send warning or message to user(s)</span> | <span class="pageSubtitle">Send warning or message to user(s)</span> | ||
<p class=" | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $SirWarn function, because it is very easy to do the same thing using a [[Daemon class|Daemon]].</p> | ||
The <var>$SirWarn</var> function is used to send a warning or message to the specified user or users. If the user invoking <var>$SirWarn</var> is a system manager or system administrator, <var>$SirWarn</var> acts like a WARN command; otherwise it acts like an MSG command. | The <var>$SirWarn</var> function is used to send a warning or message to the specified user or users. If the user invoking <var>$SirWarn</var> is a system manager or system administrator, <var>$SirWarn</var> acts like a <var>WARN</var> command; otherwise it acts like an <var>MSG</var> command. | ||
< | ==Syntax== | ||
<p class="syntax"><span class="term">%rc</span> = $SirWarn (<span class="term">user</span>, <span class="term">message</span>) | |||
</p> | |||
===Syntax terms=== | |||
<table> | |||
<tr><th>%rc</th> | |||
<td>A numeric variable that is set to indicate the success of the function.</td></tr> | |||
<tr><th>user</th> | |||
<td>Identifies the user(s) to receive the warning. | |||
<p> | |||
If this argument is the string <code>OPR</code>, the warning is sent to the operator's console (or virtual console under CMS). If this argument is a valid user number, the warning is sent to the indicated user number. If it is neither <code>OPR</code> nor a valid user number, it is treated as a userid, and the warning is sent to every user logged on to this userid. </p></td></tr> | |||
<tr><th>message</th> | |||
< | <td>The text of the warning to be sent to the user(s) indicated by the <var class="term">user</var> argument.</td></tr> | ||
< | </table> | ||
< | |||
</ | |||
<p class="code"> | ===Return codes=== | ||
<p class="code">0 - Warning issued | |||
1 - User(s) not logged on | |||
2 - Insufficient storage | |||
3 - Parameter missing (either userid or message) | |||
</p> | </p> | ||
The following statement sends a warning of an application error to the operator: | ==Examples== | ||
<ol> | |||
<p class="code"> % | <li>The following statement sends a warning of an application error to the operator: | ||
<p class="code">%rc = $SirWarn('OPR', 'Severe application error for user' WITH $USER) | |||
</p> | </p> | ||
This statement sends a warning to user 57 to leave subsystem BARNEY: | <li>This statement sends a warning to user 57 to leave subsystem <code>BARNEY</code>: | ||
<p class="code"> % | <p class="code">%rc = $SirWarn(57, 'Please leave subsystem BARNEY') | ||
</p> | </p> | ||
This statement sends a warning to all users logged on as HOMER to call Marge: | <li>This statement sends a warning to all users logged on as <code>HOMER</code> to call <code>Marge</code>: | ||
<p class="code">%rc = $SirWarn('HOMER', 'Please call Marge') | |||
<p class="code"> % | |||
</p> | </p> | ||
</ol> | |||
==Products authorizing {{PAGENAMEE}}== | ==Products authorizing {{PAGENAMEE}}== | ||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> | ||
<li>[[Sirius functions]] | <li>[[List of $functions|Sirius functions]] | ||
</ul> | </ul> | ||
[[Category:$Functions|$SirWarn]] | [[Category:$Functions|$SirWarn]] |
Latest revision as of 00:04, 7 October 2015
Send warning or message to user(s)
Note: Many $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $SirWarn function, because it is very easy to do the same thing using a Daemon.
The $SirWarn function is used to send a warning or message to the specified user or users. If the user invoking $SirWarn is a system manager or system administrator, $SirWarn acts like a WARN command; otherwise it acts like an MSG command.
Syntax
%rc = $SirWarn (user, message)
Syntax terms
%rc | A numeric variable that is set to indicate the success of the function. |
---|---|
user | Identifies the user(s) to receive the warning.
If this argument is the string |
message | The text of the warning to be sent to the user(s) indicated by the user argument. |
Return codes
0 - Warning issued 1 - User(s) not logged on 2 - Insufficient storage 3 - Parameter missing (either userid or message)
Examples
- The following statement sends a warning of an application error to the operator:
%rc = $SirWarn('OPR', 'Severe application error for user' WITH $USER)
- This statement sends a warning to user 57 to leave subsystem
BARNEY
:%rc = $SirWarn(57, 'Please leave subsystem BARNEY')
- This statement sends a warning to all users logged on as
HOMER
to callMarge
:%rc = $SirWarn('HOMER', 'Please call Marge')