Properties SourceCde
txt
1
*&---------------------------------------------------------------------*
2
*&  Include           ZUTIL_CMD_REPLACE_OLD                            *
3
*&                                                                     *
4
*&---------------------------------------------------------------------*
5
*&                                                                     *
6
*& This file is part of ZUTIL.                                         *
7
*&                                                                     *
8
*& ZUTIL is free software: you can redistribute it and/or modify       *
9
*& it under the terms of the GNU General Public License as published   *
10
*& by the Free Software Foundation, either version 3 of the License,   *
11
*& or any later version.                                               *
12
*&                                                                     *
13
*& ZUTIL is distributed in the hope that it will be useful,            *
14
*& but WITHOUT ANY WARRANTY; without even the implied warranty of      *
15
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
16
*& GNU General Public License for more details.                        *
17
*&                                                                     *
18
*& You should have received a copy of the GNU General Public License   *
19
*& along with ZUTIL. If not, see <http://www.gnu.org/licenses/>.       *
20
*&                                                                     *
21
*&---------------------------------------------------------------------*
22
*&                                                                     *
23
*&  Author:     Ruediger von Creytz     ruediger.creytz@globalbit.net  *
24
*&  Copyright:  globalBIT, LLC          http://www.globalbit.net       *
25
*&                                                                     *
26
*&---------------------------------------------------------------------*
27
 
28
 
29
*-----------------------------------------------------------------------
30
* replace_all
31
*-----------------------------------------------------------------------
32
FORM replace_all
33
  USING
34
    value(i_old)
35
    value(i_new)
36
  CHANGING
37
    c_str TYPE any.
38
 
39
  DO.
40
    IF c_str NS i_old.
41
      EXIT.
42
    ENDIF.
43
    PERFORM replace_single
44
      USING i_old i_new
45
      CHANGING c_str.
46
  ENDDO.
47
 
48
ENDFORM.                    "replace_all
49
 
50
 
51
*-----------------------------------------------------------------------
52
* replace_single
53
*-----------------------------------------------------------------------
54
FORM replace_single
55
  USING
56
    value(i_old)
57
    value(i_new)
58
  CHANGING
59
    c_str TYPE any.
60
 
61
  REPLACE i_old WITH i_new INTO c_str.
62
 
63
ENDFORM.                    "replace_single