Template:CharacterMap example

From m204wiki
Revision as of 16:15, 10 October 2016 by Dme (talk | contribs) (Created page with "Most of the <var>CharacterMap</var> methods are shown in the following example, which also features the intrinsic <var>String</var> function, <var>Translate (String function...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Most of the CharacterMap methods are shown in the following example, which also features the intrinsic String function, Translate. In the example, a new CharacterMap is the argument for the Translate method; then that map is copied and modified, and the modified map is used in a second Translate call:

begin %map is object characterMap %map2 is object characterMap %ls is longstring %map = New(in='x-', out='!c') %ls = 'xu--exx' printtext {~} = '{%ls:translate(%map)}' %map2 = %map:Copy %map2:Update(in='x',out='s') printtext {~} = '{%ls:translate(%map2)}' end

The result is:

%ls:translate(%map) = '!ucce!!' %ls:translate(%map2) = 'success'