$LangSpc: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Mlarocca moved page $Langspc to $LangSpc: Lower case change)
m (Fix the NOT sign.)
Line 39: Line 39:
<tr>
<tr>
<td>NOT</td>
<td>NOT</td>
<td></td>
<td>^</td>
<td>Not sign</td>
<td>Not sign</td>
</tr>
</tr>

Revision as of 23:00, 15 August 2014

$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.

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.

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 in the Rocket Model 204 Parameter and Command Reference Manual for the 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)