Product SiteDocumentation Site

8.66. SysStemCopy


>>-SysStemCopy--(--fromstem--,--tostem-------------------------->

>--+------------------------------------------------------------------+--)-><
   +-,--+------+--+-------------------------------------------------+-+
        +-from-+  +-,--+----+--+----------------------------------+-+
                       +-to-+  +-,--+-------+--+----------------+-+
                                    +-count-+  +-,--"--+-I-+--"-+
                                                       +-O-+

Copies items from the source stem to the target stem. Items in the source stem are copied starting at the from index (default is 1) into the target stem beginning at the to index (default is 1). The number of items to be copied to the target stem can be specified with the count. The default is to copy all items in the source stem.
You can also specify that the items are to be inserted into the target stem at the position and the existing items are shifted to the end.
This function operates only on stem arrays that specify the number of items in stem.0 and all items must be numbered from 1 to n without omitting an index.
Parameters:
fromstem
The name of the source stem.
tostem
The name of the target stem.
from
The first index in the source stem to be copied.
to
The position at which the items are to be inserted in the target stem.
count
The number of items to be copied or inserted.
insert
Either of the following values:
I
Insert items.
O
Overwrite items.
Return codes:
0
The stem was copied successfully.
-1
Copying the stem failed.

Example 8.37. RexxUtil - SysStemcopy

Source.0 = 3
Source.1 = "Hello"
Source.2 = "from"
Source.3 = "Rexx"
Call SysStemCopy "Source.", "Target."

Call SysStemCopy "Source.", "Target.", 1, 5, 2, "I"