1 01/30/84  mrl_
 2 
 3 Entry points in mrl_:
 4      (list is generated by the help command)
 5 
 6 
 7 :Entry: mrl_: 01/30/84  mrl_
 8 
 9 Function:  moves a character string by copying the characters from
10 right to left.
11 
12 
13 Syntax:
14 declare mrl_ entry (ptr, fixed bin(21), ptr, fixed bin(21));
15 call mrl_ (input_ptr, input_lth, output_ptr, output_lth);
16 
17 
18 Arguments:
19 input_ptr
20    is a pointer to the input character string.  (Input)
21 input_lth
22    is the length of the input string in characters.  (Input)
23 output_ptr
24    is a pointer to the output character string.  (Input)
25 output_lth
26    is the length of the output string in characters.  (Input)
27 
28 
29 Notes: If the output string is shorter than the input string, only the
30 last output_lth characters of the input string are moved.  If the
31 output string is longer than the input string, the output string is
32 padded on the left with blanks.
33 
34 
35 The following call to mrl_ --
36 
37      call mrl_ (addcharno (addr (text), start), lth,
38                 addcharno (addr (text), start+N), lth);
39 
40 where N is a positive number is equivalent to the following PL/I loop--
41 
42      do i = lth to 1 by -1;
43        substr (text, (start+N+i-1), 1) = substr (text, (start+i-1), 1);
44      end;
45 
46 Due to the nature of the Multics hardware, if the input and output
47 strings overlap and the output string is to the left of the input
48 string (ie: N, above, were a negative number), the results of the call
49 to mrl_ will be different from the results of the above PL/I loop.
50 
51 
52 Note that the following PL/I statement --
53 
54      substr (text, start+N, lth) = substr (text, start, lth);
55 
56 will not work properly as the code generated by the compiler moves the
57 character string from left to right which destroys the contents of the
58 string.