New (CharacterMap constructor): Difference between revisions
Jump to navigation
Jump to search
m (1 revision: CharacterMap, RandomNumberGenerator, StringTokenizer methods) |
mNo edit summary |
||
Line 1: | Line 1: | ||
<span style="font-size:120%; color:black"><b>Create CharacterMap object</b></span> | <span style="font-size:120%; color:black"><b>Create CharacterMap object</b></span> | ||
[[Category:CharacterMap methods|New constructor]] | [[Category:CharacterMap methods|New constructor]] | ||
<!--DPL?? Category:CharacterMap methods|New constructor: Create CharacterMap object--> | <!--DPL?? Category:CharacterMap methods|New constructor: Create CharacterMap object--> | ||
<!--DPL?? Category:System methods|New (CharacterMap constructor): Create CharacterMap object--> | <!--DPL?? Category:System methods|New (CharacterMap constructor): Create CharacterMap object--> |
Revision as of 19:50, 31 December 2010
Create CharacterMap object
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
%map = New(In=string [, Out=string] [, Pad=char])
Syntax terms
- %map
- A CharacterMap object variable.
- In=string
- 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=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 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.