New (CharacterMap constructor): Difference between revisions
Jump to navigation
Jump to search
m (match Terms term to term used in syntax fig) |
mNo edit summary |
||
Line 18: | Line 18: | ||
<tr><th>%characterMap</th> | <tr><th>%characterMap</th> | ||
<td>A CharacterMap object variable.</td></tr> | <td>A CharacterMap object variable.</td></tr> | ||
<tr><th> | <tr><th>in</th> | ||
<td>A required, name required, argument that specifies the "input table" characters in the mapping. | <td>A required, name required, argument that specifies the "input table" characters in the mapping. | ||
No character duplications are allowed in the In string, which may not be more than 256 characters.</td></tr> | No character duplications are allowed in the In string, which may not be more than 256 characters.</td></tr> | ||
<tr><th> | <tr><th>out</th> | ||
<td>An optional, name required, argument that specifies the "output table" characters. | <td>An optional, name required, argument that specifies the "output table" characters. | ||
<var class="term">out</var> may not be longer than <var class="term">in</var>; it may be shorter, however, as long as a pad character is specified. <var class="term">out</var> may not be more than 256 characters.</td></tr> | |||
<tr><th> | <tr><th>pad</th> | ||
<td>An optional, name required, argument that specifies the character used to pad the output table string on the right if it is shorter than | <td>An optional, name required, argument that specifies the character used to pad the output table string on the right if it is shorter than <var class="term">in</var>. | ||
<var class="term">pad</var> must be a single character, only. | |||
</td></tr> | </td></tr> | ||
</table> | </table> |
Revision as of 16:25, 17 January 2011
Create CharacterMap object (CharacterMap class)
New is a member of the CharacterMap class.
The New method creates a character map, which associates individual characters from an In string (the "input table") with the characters in the corresponding position in the "output table". The output table consists of the characters in the Out string (plus copies of the Pad character, if necessary).
Syntax
%characterMap = [%(CharacterMap):]New( In= string, [Out= string], [Pad= c])
Syntax terms
%characterMap | A CharacterMap object variable. |
---|---|
in | A required, name required, argument that specifies the "input table" characters in the mapping. No character duplications are allowed in the In string, which may not be more than 256 characters. |
out | An optional, name required, argument that specifies the "output table" characters. out may not be longer than in; it may be shorter, however, as long as a pad character is specified. out may not be more than 256 characters. |
pad | An optional, name required, argument that specifies the character used to pad the output table string on the right if it is shorter than in.
pad must be a single character, only. |
Usage notes
- Case is respected in all character specifications.
- If the In string is longer than the Out string, the "extra" In characters are associated with the Pad character. In this case, it is a request-canceling error if no Pad character is present.
- The Out argument can be omitted, as long as a Pad argument is present. The Pad argument has no default.
- For an example of a New method call, see the CharacterMap class page.