String (Subsystem function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:Subsystem:String subtitle}}
{{Template:Subsystem:String subtitle}}
The <var>String</var> read-only property returns the current value of a <var>Subsystem</var> string.
The <var>String</var> [[Classes and Objects#readWrite|readOnly]] property returns the current value of a [[System and Subsystem classes#System and subsystem globals and strings|subsystem string]].


==Syntax==
==Syntax==
{{Template:Subsystem:String syntax}}
{{Template:Subsystem:String syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%value</th><td>This string is set to the current value of the named string, or it is set to null if the named string is not set.</td></tr>
<tr><th>%value</th>
<tr><th><var>%(Subsystem)</var></th><td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>String</var> can also be invoked via a <var>Subsystem</var> object variable, which may be <var>null</var>.</td></tr>
<td>This string is set to the current value of the named string, or it is set to null if the named string is not set.</td></tr>
<tr><th>name</th> <td>A string that identifies the global string to be retrieved.</td></tr>
 
<tr><th><var class="nobr">%(Subsystem)</var></th>
<td>The class name in parentheses denotes a [[Notation conventions for methods#Shared methods|shared]] method. <var>String</var> can also be invoked via a <var>Subsystem</var> object variable, which may be <var>null</var>.</td></tr>
 
<tr><th>name</th>  
<td>A string that identifies the global string to be retrieved.</td></tr>
</table>
</table>




==Usage notes==
==Usage notes==
<ul><li><var>String</var> retrieves the string for the current <var>subsystem</var> context, which is indicated by the <var>[[Context_(Subsystem_property)|Context]]</var> property.
<ul>
<li><var>String</var> retrieves the string for the current <var>subsystem</var> context, which is indicated by the <var>[[Context_(Subsystem_property)|Context]]</var> property.
</ul>
</ul>


==Examples==
==Examples==
<ol><li>The following statement prints the value of the subsystem string called EMERALDS:
<ol>
<li>The following statement prints the value of the subsystem string called <code>EMERALDS</code>:
<p class="code">print %(subsystem):string('EMERALDS')</p>
<p class="code">print %(subsystem):string('EMERALDS')</p>
<li>A common use of system strings might be to hold a complex shared data-structure in the form of XML. Such a string can be loaded into an <var>[[XmlDoc_API#The_XmlDoc_class|XmlDoc]]</var> object fairly easily:
<li>A common use of system strings might be to hold a complex shared data-structure in the form of XML. Such a string can be loaded into an <var>[[XmlDoc_API#The_XmlDoc_class|XmlDoc]]</var> object fairly easily:
<p class="code">%sharedDoc is object xmlDoc auto new
<p class="code">%sharedDoc is object xmlDoc auto new

Latest revision as of 00:31, 16 February 2014

Get a subsystem string (Subsystem class)

The String readOnly property returns the current value of a subsystem string.

Syntax

%value = %(Subsystem):String( name)

Syntax terms

%value This string is set to the current value of the named string, or it is set to null if the named string is not set.
%(Subsystem) The class name in parentheses denotes a shared method. String can also be invoked via a Subsystem object variable, which may be null.
name A string that identifies the global string to be retrieved.


Usage notes

  • String retrieves the string for the current subsystem context, which is indicated by the Context property.

Examples

  1. The following statement prints the value of the subsystem string called EMERALDS:

    print %(subsystem):string('EMERALDS')

  2. A common use of system strings might be to hold a complex shared data-structure in the form of XML. Such a string can be loaded into an XmlDoc object fairly easily:

    %sharedDoc is object xmlDoc auto new ... %sharedDoc:loadXml(%(system):string('SharedDoc'))

See also