$ChkPat: Difference between revisions
(Automatically generated page update) |
mNo edit summary |
||
Line 9: | Line 9: | ||
<li>When <var class="term">language</var> is omitted, <var class="product">Model 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 <var class="term">language</var> is omitted, <var class="product">Model 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> | </li> | ||
<li>An asterisk enclosed in quotation marks ('*') instructs <var class="product">Model 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 204</var> to use the value of the LANGUSER parameter.</li> | ||
</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 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 LANGUSER parameter in the Rocket <var class="product">Model 204</var> Parameter and Command Reference Manual for the valid values.</li> | ||
Line 26: | Line 26: | ||
</p> | </p> | ||
<p>For French Canadian:</p> | <p>For French Canadian:</p> | ||
<p class="code">%PAT='p&# | <p class="code">%PAT='pêché' | ||
%X=$CHKPAT(%PAT,'FRENCHC') | %X=$CHKPAT(%PAT,'FRENCHC') |
Revision as of 21:33, 5 June 2013
The $CHKPAT function verifies the syntax of a pattern. If the pattern is valid, a null string is returned; otherwise, an error message string is returned.
Syntax
$CHKPAT(pattern[,language])
Where:
The required pattern argument is the string of characters to verify, which can be a literal enclosed in quotation marks or a %variable.
The optional language argument specifies the language to use. The language argument is handled as follows:
- When language is omitted, 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.
Without $CHKPAT, pattern syntax errors can cause cancellation of the request or require the coding of complex ON units.
Examples
For U.S. English:
%PAT='ABC*' %X=$CHKPAT(%PAT) IF %X NE '' THEN PRINT %X JUMP TO ERROR.RETURN END IF
For French Canadian:
%PAT='pêché' %X=$CHKPAT(%PAT,'FRENCHC') IF %X NE '' THEN PRINT %X JUMP TO ERROR.RETURN END IF
Usage notes
$CHKPAT supports language-sensitive specification of patterns through an optional second parameter (such as $ALPHA and $ALPHNUM).
All characters X'00' through X'FF' are valid in a pattern presented to the User Language pattern matcher. The $CHKPAT function no longer invokes either of the following messages when it encounters these characters.
M204.1688: errortype IN PATTERN 'pattern' AT CHARACTER char M204.1689: errortype IN PATTERN 'pattern' AT CHARACTER char