*&---------------------------------------------------------------------*
*&  Include           ZUTIL_CMD_REPLACE_OLD                            *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*& This file is part of ZUTIL.                                         *
*&                                                                     *
*& ZUTIL is free software: you can redistribute it and/or modify       *
*& it under the terms of the GNU General Public License as published   *
*& by the Free Software Foundation, either version 3 of the License,   *
*& or any later version.                                               *
*&                                                                     *
*& ZUTIL is distributed in the hope that it will be useful,            *
*& but WITHOUT ANY WARRANTY; without even the implied warranty of      *
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
*& GNU General Public License for more details.                        *
*&                                                                     *
*& You should have received a copy of the GNU General Public License   *
*& along with ZUTIL. If not, see <http://www.gnu.org/licenses/>.       *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&  Author:     Ruediger von Creytz     ruediger.creytz@globalbit.net  *
*&  Copyright:  globalBIT, LLC          http://www.globalbit.net       *
*&                                                                     *
*&---------------------------------------------------------------------*


*-----------------------------------------------------------------------
* replace_all
*-----------------------------------------------------------------------
FORM replace_all
  USING
    value(i_old)
    value(i_new)
  CHANGING
    c_str TYPE any.

  DO.
    IF c_str NS i_old.
      EXIT.
    ENDIF.
    PERFORM replace_single
      USING i_old i_new
      CHANGING c_str.
  ENDDO.

ENDFORM.                    "replace_all


*-----------------------------------------------------------------------
* replace_single
*-----------------------------------------------------------------------
FORM replace_single
  USING
    value(i_old)
    value(i_new)
  CHANGING
    c_str TYPE any.

  REPLACE i_old WITH i_new INTO c_str.

ENDFORM.                    "replace_single
