SetGlobal (System subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Automatically generated page update)
 
m (copied content from PDF and updated to be system only)
Line 1: Line 1:
{{Template:System:SetGlobal subtitle}}
{{Template:System:SetGlobal subtitle}}
The <var>SetGlobal</var> shared subroutine sets a <var>[[System_class|System]]</var> global.


==Syntax==
==Syntax==
Line 5: Line 6:
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>(System)</th>
<tr><th>%(System)</th>
<td>The class name in parentheses denotes a shared method. SetGlobal can also be invoked via a System object variable, which may be null.</td></tr>
<td>The class name in parentheses denotes a shared method. <var>SetGlobal</var> can also be invoked via a <var>System</var> object variable, which may be null.</td></tr>
<tr><th>string</th>
<tr><th>name</th>
<td><var>String</var> object</td></tr>
<td>A string that identifies the global to be set.</td></tr>
<tr><th>string</th>
<tr><th>value</th>
<td><var>String</var> object</td></tr>
<td>A string that identifies the new value for the global.</td></tr>
</table>
</table>
==Usage notes==
==Usage notes==
<ul><li>All errors result in request cancellation.
<li>It is not an error to set a global that is not set.
<li>Like <var>[[$Setg_Sys]]</var>, the <var>SetGlobal</var> method momentarily turns off multi-processing, so should not be used heavily in an <var class="product">MP/204</var> environment.
</ul>
==Examples==
==Examples==
<ol><li>The following statement sets the system global called CHOLERIC:
<p class="code">%(system):setGlobal('CHOLERIC', 'ANGRY')</p>
</ol>
==See also==
==See also==
<ul><li>The <var>setGlobal</var> method, in the <var>System</var> class, performs a function identical to the <var>$setg_sys</var> function.  That is, the following two statements are identical:
<p class="code">%(system):setGlobal('PHLEGMATIC', 'STOLID')
%setg_sys('PHLEGMATIC', 'STOLID')</p>
<li>For more information about system  globals, see [[System_class#System_and_subsystem_globals_and_strings|“System globals and strings”]].</ul>
{{Template:System:SetGlobal footer}}
{{Template:System:SetGlobal footer}}

Revision as of 11:28, 24 March 2011

Set a system-wide global (System class)

The SetGlobal shared subroutine sets a System global.

Syntax

%(System):SetGlobal( name, value)

Syntax terms

%(System) The class name in parentheses denotes a shared method. SetGlobal can also be invoked via a System object variable, which may be null.
name A string that identifies the global to be set.
value A string that identifies the new value for the global.

Usage notes

  • All errors result in request cancellation.
  • It is not an error to set a global that is not set.
  • Like $Setg_Sys, the SetGlobal method momentarily turns off multi-processing, so should not be used heavily in an MP/204 environment.

Examples

  1. The following statement sets the system global called CHOLERIC:

    %(system):setGlobal('CHOLERIC', 'ANGRY')

See also

  • The setGlobal method, in the System class, performs a function identical to the $setg_sys function. That is, the following two statements are identical:

    %(system):setGlobal('PHLEGMATIC', 'STOLID') %setg_sys('PHLEGMATIC', 'STOLID')

  • For more information about system globals, see “System globals and strings”.