$DaemonParentNumber: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Automatically generated page update) |
||
(17 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$DaemonParentNumber}} | {{DISPLAYTITLE:$DaemonParentNumber}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Get user number of parent thread</span> | ||
<p class=" | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $DaemonParentNumber function is the <var>[[ParentNumber (Daemon property)|ParentNumber]]</var>. The OO APIs emphasize the use of the [[List of Daemon methods|Daemon methods]]; users are strongly urged to use the new Daemon API instead of the old $functions.</p> | ||
This function can be used to get the user number of an sdaemon's parent thread. | This function can be used to get the user number of an sdaemon's parent thread. | ||
Line 8: | Line 8: | ||
The $DaemonParentNumber function accepts no arguments. | The $DaemonParentNumber function accepts no arguments. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax" | <p class="syntax">%USERN = $DaemonParentNumber | ||
</p> | </p> | ||
<p | <p> | ||
</p> | |||
<p>%USERN is set to parent's user number, or to -1 if not called from a daemon</p> | |||
==Usage notes== | |||
<ul> | |||
<li>The $DaemonParentNumber function returns the user number of the thread that created the daemon thread, whether the daemon is associated with a Daemon object or with a <var>$COMMxx</var> function. | |||
<li>If the thread issuing $DaemonParentNumber is not an sdaemon, or is an sdaemon but is not performing work for another thread via a Daemon object or a <var>$COMMxx</var> function, or is an asynchronous daemon, the $DaemonParentNumber function returns a -1 value. | |||
<li>This $function is new in Version 6.8 of the <var class="product">[[Sirius Mods]]</var>. | |||
</ul> | |||
==Example== | |||
The following code audits a thread's parent user number: | The following code audits a thread's parent user number: | ||
<p class="code"> audit 'My parent | <p class="code">audit 'My parent''s user number is ' $DaemonParentNumber | ||
</p> | </p> | ||
[[Category:$Functions|$DaemonParentNumber]] | [[Category:$Functions|$DaemonParentNumber]] |
Latest revision as of 22:51, 20 September 2018
Get user number of parent thread
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $DaemonParentNumber function is the ParentNumber. The OO APIs emphasize the use of the Daemon methods; users are strongly urged to use the new Daemon API instead of the old $functions.
This function can be used to get the user number of an sdaemon's parent thread.
The $DaemonParentNumber function accepts no arguments.
Syntax
%USERN = $DaemonParentNumber
%USERN is set to parent's user number, or to -1 if not called from a daemon
Usage notes
- The $DaemonParentNumber function returns the user number of the thread that created the daemon thread, whether the daemon is associated with a Daemon object or with a $COMMxx function.
- If the thread issuing $DaemonParentNumber is not an sdaemon, or is an sdaemon but is not performing work for another thread via a Daemon object or a $COMMxx function, or is an asynchronous daemon, the $DaemonParentNumber function returns a -1 value.
- This $function is new in Version 6.8 of the Sirius Mods.
Example
The following code audits a thread's parent user number:
audit 'My parent''s user number is ' $DaemonParentNumber