Update (CharacterMap subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 13: Line 13:
{{Template:CharacterMap:Update syntax}}
{{Template:CharacterMap:Update syntax}}
===Syntax terms===
===Syntax terms===
<dl>
<table class="syntax">
<dt><i>%map</i>
<th>%map</th>
<dd>A CharacterMap object variable.
<td>A CharacterMap object variable.</td>
<dt><b>In=</b><i>string</i>
<th>In=string</th>
<dd>A required, name required, argument that specifies the &ldquo;input table&rdquo;
<td>A required, name required, argument that specifies the "input table"
characters that you are adding or resetting.
characters that you are adding or resetting.


No character can be specified more than once in the In string, which
No character can be specified more than once in the In string, which
may not be more than 256 characters.
may not be more than 256 characters.</td>
<dt><b>Out=</b><i>string</i>
<th>Out=string</th>
<dd>An optional, name required, argument that specifies the &ldquo;output table&rdquo;
<td>An optional, name required, argument that specifies the "output table"
characters.
characters.


The Out string may not be longer than the In string; it may be shorter, however,
The Out string may not be longer than the In string; it may be shorter, however,
as long as a Pad character is specified.
as long as a Pad character is specified.
The Out string may not be more than 256 characters.
The Out string may not be more than 256 characters.</td>
<dt><b>Pad=</b><i>char</i>
<th>Pad=char</th>
<dd>An optional, name required, argument that specifies the character used
<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 the In string.
to pad the output table string on the right if it is shorter than the In string.


''char'' must be a single character, only.
''char'' must be a single character, only.
 
</td>
</dl>
</table>
==Usage notes==
==Usage notes==
<ul>
<ul>
Line 43: Line 43:
If an In string character you specify is not already mapped, the association
If an In string character you specify is not already mapped, the association
indicated in the Update call is added to the method object's mapping.
indicated in the Update call is added to the method object's mapping.
<li>If the In string is longer than the Out string, the &ldquo;extra&rdquo; In
<li>If the In string is longer than the Out string, the "extra" In
characters are associated with the Pad character.
characters are associated with the Pad character.
In this case, it is a request-canceling error if no Pad character is present.
In this case, it is a request-canceling error if no Pad character is present.

Revision as of 16:54, 15 January 2011

Update this CharacterMap (CharacterMap class)

Update is a member of the CharacterMap class.

The method lets you modify existing character associations or add new ones. The method's parameters and mapping rules are the same as the New method.

Syntax

characterMap:Update( In= string, [Out= string], [Pad= c])

Syntax terms

%map A CharacterMap object variable. In=string A required, name required, argument that specifies the "input table"

characters that you are adding or resetting.

No character can be specified more than once in the In string, which

may not be more than 256 characters.
Out=string An optional, name required, argument that specifies the "output table"

characters.

The Out string may not be longer than the In string; it may be shorter, however, as long as a Pad character is specified.

The Out string may not be more than 256 characters.
Pad=char An optional, name required, argument that specifies the character used

to pad the output table string on the right if it is shorter than the In string.

char must be a single character, only.

Usage notes

  • Case is respected in all character specifications.
  • If an In string character you specify is already mapped in the method object, the existing mapping is modified by the association indicated in the Update call. If an In string character you specify is not already mapped, the association indicated in the Update call is added to the method object's mapping.
  • 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 an Update call, see the CharacterMap class page.