SetGlobal (Subsystem subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
{{Template:Subsystem:SetGlobal subtitle}}
{{Template:Subsystem:SetGlobal subtitle}}
The <var>SetGlobal</var> shared subroutine sets a <var>[[Subsystem_class|Subsystem]]</var> global.
The <var>SetGlobal</var> shared subroutine sets a [[Subsystem_class#System_and_subsystem_globals_and_strings|subsystem global]].


==Syntax==
==Syntax==
{{Template:Subsystem:SetGlobal syntax}}
{{Template:Subsystem:SetGlobal syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th><var>%(Subsystem)</var></th>
<tr><th><var>%(Subsystem)</var></th>
<td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>SetGlobal</var> can also be invoked via a <var>Subsystem</var> object variable, which may be <var>null</var>.</td></tr>
<td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>SetGlobal</var> can also be invoked via a <var>Subsystem</var> object variable, which may be <var>Null</var>.</td></tr>
 
<tr><th>name</th>
<tr><th>name</th>
<td>A string that identifies the global to be set.</td></tr>
<td>A string that identifies the global to be set.</td></tr>
<tr><th>value</th>
<tr><th>value</th>
<td>A string that identifies the new value for the global.</td></tr>
<td>A string that identifies the new value for the global.</td></tr>
Line 15: Line 18:


==Usage notes==
==Usage notes==
<ul><li>All errors result in request cancellation.
<ul>
<li>All errors result in request cancellation.
 
<li>It is not an error to set a global that is not set.
<li>It is not an error to set a global that is not set.
<li>The <var>Subsystem</var> class <var>SetGlobal</var> sets the global for the current <var>subsystem</var> context (indicated by <var>[[Context_(Subsystem_property)|Context]]</var>).
<li>The <var>Subsystem</var> class <var>SetGlobal</var> sets the global for the current <var>subsystem</var> context (indicated by <var>[[Context_(Subsystem_property)|Context]]</var>).
<li>Like <var>[[$Setg_Subsys]]</var>, <var>SetGlobal</var> momentarily turns off multi-processing, so should not be used heavily in an <var class="product">MP/204</var> environment.  <var>[[SetString_(Subsystem_function)|SetString]]</var> does not suffer this limitation and should be used in these situations.
<li>Like <var>[[$Setg_Subsys]]</var>, <var>SetGlobal</var> momentarily turns off multi-processing, so should not be used heavily in an <var class="product">MP/204</var> environment.  <var>[[SetString_(Subsystem_function)|SetString]]</var> does not suffer this limitation and should be used in these situations.
</ul>
</ul>

Revision as of 21:31, 16 November 2012

Set a subsystem global (Subsystem class)

The SetGlobal shared subroutine sets a subsystem global.

Syntax

%(Subsystem):SetGlobal( name, value)

Syntax terms

%(Subsystem) The class name in parentheses denotes a shared method. SetGlobal can also be invoked via a Subsystem 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.
  • The Subsystem class SetGlobal sets the global for the current subsystem context (indicated by Context).
  • Like $Setg_Subsys, SetGlobal momentarily turns off multi-processing, so should not be used heavily in an MP/204 environment. SetString does not suffer this limitation and should be used in these situations.

See also

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

    %(subsystem):setGlobal('PHLEGMATIC', 'STOLID') %setg_subsys('PHLEGMATIC', 'STOLID')

  • For more information about subsystem globals, see "System and Subsystem globals and strings".