String (System function): Difference between revisions
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:String subtitle}} | {{Template:System:String subtitle}} | ||
The <var>String</var> read-only property returns the current value of a <var>System</var> string. | |||
==Syntax== | ==Syntax== | ||
Line 5: | Line 6: | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>% | <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>(System)</th> | <tr><th>%(System)</th><td>The class name in parentheses denotes a shared method. <var>String</var> can also be invoked via a <var>System</var> object variable, which may be <var>null</var>.</td></tr> | ||
<td>The class name in parentheses denotes a shared method. String can also be invoked via a System object variable, which may be null.</td></tr> | <tr><th>name</th> <td>A string that identifies the global string to be retrieved.</td></tr> | ||
<tr><th> | |||
<td> | |||
</table> | </table> | ||
==Examples== | ==Examples== | ||
<ol><li>The following statement prints the value of the subsystem string called EMERALDS: | |||
<p class="code">print %(system):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: | |||
<p class="code">%sharedDoc is object xmlDoc auto new | |||
... | |||
%sharedDoc:[[LoadXml_(XmlDoc/XmlNode_function)|loadXml]](%(system):string('SharedDoc'))</p> | |||
</ol> | |||
==See also== | ==See also== | ||
{{Template:System:String footer}} | {{Template:System:String footer}} |
Revision as of 06:35, 25 March 2011
Get a system-wide string (System class)
The String read-only property returns the current value of a System string.
Syntax
%value = %(System):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. |
---|---|
%(System) | The class name in parentheses denotes a shared method. String can also be invoked via a System object variable, which may be null. |
name | A string that identifies the global string to be retrieved. |
Examples
- The following statement prints the value of the subsystem string called EMERALDS:
print %(system):string('EMERALDS')
- 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'))