$LangSpc: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Mlarocca moved page $LANGSPEC to $Langspc: Lower case change)
No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<p>$LANGSPC returns a string containing the binary value of the specified character in the specified language. You can use $LANGSPC to scan user input for a special character in a language independent manner.</p>
<p>
<p>You can also use the $LANGSPC function to ensure that any special character that has a different hexadecimal code value or terminates with a language other that U.S. English is displayed correctly.</p>
<var>$LangSpc</var> returns a string containing the hexadecimal value of the specified character in the specified language. You can use <var>$LangSpc</var> to scan user input for a special character in a language independent manner. A printout or display of the returned value will be the character representation based on the language argument.</p>
<b>Syntax</b>
<p>
<p class="code">$LANGSPC('charname'[,langname])
You can also use the <var>$LangSpc</var> function to ensure that any special character that has a different hexadecimal code value or terminates with a language other than U.S. English is displayed correctly.</p>
 
==Syntax==
<p class="syntax">$LANGSPC('<span class="term">charname</span>'[, <span class="term">langname</span>])
</p>
</p>
<p>where:</p>
<p>
<p><var>The charname</var> argument is a string containing one of the following values:</p>
Where:</p>
<p>
The <var class="term">charname</var> argument is a string containing one of the following values:</p>
 
<table>
<table>
<tr>
<tr class="head"><th>Valid <i>charname</i></th>
<td>Valid charname</td>
<th>Character</th>
<td>Character</td>
<th>Description</th>
<td>Description</td>
</tr>
</tr>
<tr>
<tr>
<td>AT</td>
<td>AT</td>
Line 17: Line 23:
<td>At sign</td>
<td>At sign</td>
</tr>
</tr>
<tr>
<tr>
<td>BACKSLSH</td>
<td>BACKSLSH</td>
Line 22: Line 29:
<td>Backslash</td>
<td>Backslash</td>
</tr>
</tr>
<tr>
<tr>
<td>DOLLAR</td>
<td>DOLLAR</td>
Line 27: Line 35:
<td>Dollar sign</td>
<td>Dollar sign</td>
</tr>
</tr>
<tr>
<tr>
<td>DQUOTE</td>
<td>DQUOTE</td>
Line 32: Line 41:
<td>Double quotation mark</td>
<td>Double quotation mark</td>
</tr>
</tr>
<tr>
<tr>
<td>EXCLAMAT</td>
<td>EXCLAMAT</td>
Line 37: Line 47:
<td>Exclamation point</td>
<td>Exclamation point</td>
</tr>
</tr>
<tr>
<tr>
<td>NOT</td>
<td>NOT</td>
<td></td>
<td>¬</td>
<td>Not sign</td>
<td>Not sign</td>
</tr>
</tr>
<tr>
<tr>
<td>RBRACE</td>
<td>RBRACE</td>
Line 47: Line 59:
<td>Closing square brace or right square brace</td>
<td>Closing square brace or right square brace</td>
</tr>
</tr>
<tr>
<tr>
<td>SHARP</td>
<td>SHARP</td>
Line 52: Line 65:
<td>Number sign or pound sign</td>
<td>Number sign or pound sign</td>
</tr>
</tr>
<tr>
<tr>
<td>VERTICAL</td>
<td>VERTICAL</td>
Line 58: Line 72:
</tr>
</tr>
</table>
</table>
<p>The optional <var class="term">language</var> argument specifies which language to use to obtain the desired hexadecimal code for the specified character. The request is canceled with an error message if the name is not found in NLANG. The language argument is handled as follows:</p>
 
<p>
The optional <var class="term">language</var> argument specifies which language to use to obtain the desired hexadecimal code for the specified character. The request is canceled with an error message if the name is not found in NLANG. The language argument is handled as follows:</p>
<ul>
<ul>
<li>When you omit the <var class="term">language</var> argument, <var class="product">Model&nbsp;204</var> performs the validation in U.S. English, even if the value of the LANGUSER parameter is not US, and lowercase characters are not recognized.</li>
<li>When you omit the <var class="term">language</var> argument, <var class="product">Model&nbsp;204</var> performs the validation in U.S. English (even if the value of the <var>LANGUSER</var> parameter is not US) and lowercase characters are not recognized.</li>
</li>
 
<li>An asterisk enclosed in quotation marks ('*') instructs <var class="product">Model&nbsp;204</var> to use the value of the LANGUSER parameter.</li>
<li>An asterisk enclosed in quotation marks (<tt>'*'</tt>) instructs <var class="product">Model&nbsp;204</var> to use the value of the <var>LANGUSER</var> parameter.</li>
</li>
 
<li>You can enter the name of a valid language enclosed in quotation marks or a %variable containing a valid language. If the value you enter is not supported, the request is canceled with an error message. See The LANGUSER parameter in the Rocket <var class="product">Model&nbsp;204</var> Parameter and Command Reference Manual for the valid values.</li>
<li>You can enter the name of a valid language enclosed in quotation marks or a %variable containing a valid language. If the value you enter is not supported, the request is canceled with an error message. See the <var>[[LANGUSER parameter|LANGUSER]]</var> parameter for valid values.</li>
</li>
</ul>
</ul>
<b>Example</b>
 
<p>In the following example, the %PATH variable (presumably supplied by the user from the terminal) is searched for the backslash character, regardless of its location in the user terminal's code table:</p>
==Example==
<p>
In the following example, the %PATH variable (presumably supplied by the user from the terminal) is searched for the backslash character, regardless of its location in the user terminal's code table:</p>
<p class="code">%BACKSLASH IS STRING LEN 1
<p class="code">%BACKSLASH IS STRING LEN 1
%BACKSLASH = $LANGSPC('BACKSLSH','*')
%BACKSLASH = $LANGSPC('BACKSLSH','*')
%DIR  = $SUBSTR(%PATH, $INDEX(%PATH,%BACKSLASH)+1)
%DIR  = $SUBSTR(%PATH, $INDEX(%PATH,%BACKSLASH)+1)
</p>
</p>
[[Category:SOUL $functions]]
[[Category:SOUL $functions]]

Latest revision as of 18:57, 8 March 2016

$LangSpc returns a string containing the hexadecimal value of the specified character in the specified language. You can use $LangSpc to scan user input for a special character in a language independent manner. A printout or display of the returned value will be the character representation based on the language argument.

You can also use the $LangSpc function to ensure that any special character that has a different hexadecimal code value or terminates with a language other than U.S. English is displayed correctly.

Syntax

$LANGSPC('charname'[, langname])

Where:

The charname argument is a string containing one of the following values:

Valid charname Character Description
AT @ At sign
BACKSLSH \ Backslash
DOLLAR $ Dollar sign
DQUOTE " Double quotation mark
EXCLAMAT ! Exclamation point
NOT ¬ Not sign
RBRACE ] Closing square brace or right square brace
SHARP # Number sign or pound sign
VERTICAL | Vertical bar

The optional language argument specifies which language to use to obtain the desired hexadecimal code for the specified character. The request is canceled with an error message if the name is not found in NLANG. The language argument is handled as follows:

  • When you omit the language argument, Model 204 performs the validation in U.S. English (even if the value of the LANGUSER parameter is not US) and lowercase characters are not recognized.
  • An asterisk enclosed in quotation marks ('*') instructs Model 204 to use the value of the LANGUSER parameter.
  • You can enter the name of a valid language enclosed in quotation marks or a %variable containing a valid language. If the value you enter is not supported, the request is canceled with an error message. See the LANGUSER parameter for valid values.

Example

In the following example, the %PATH variable (presumably supplied by the user from the terminal) is searched for the backslash character, regardless of its location in the user terminal's code table:

%BACKSLASH IS STRING LEN 1 %BACKSLASH = $LANGSPC('BACKSLSH','*') %DIR = $SUBSTR(%PATH, $INDEX(%PATH,%BACKSLASH)+1)