PROCEDURE
PARSE ARG from_array, to_array, from, upto, into
SAY 'from_array 'from_array
SAY 'into 'into
hi_to = arrayhi(to_array)
hi_from = arrayhi(from_array)
sw_insert = 1
IF into = "" THEN
into = 1
IF into >= hi_to THEN
sw_insert = 0
IF sw_insert = 1 THEN
DO
nr_elements = (upto - into) + 1
temp_token = globals("temp_array",nr_elements)
rc = copyglobal(to_array, temp_token,into, upto, 1 )
SAY 'Temp records copied = 'rc
END
rc = copyglobal(from_array, to_array, 1, , into)
hi=arrayhi(to_array)
DO i = 1 TO hi
content=gets(to_array,i)
SAY content
END
IF sw_insert = 1 THEN
DO
y = into + hi_from
rc = copyglobal(temp_token, to_array, 1, , y)
SAY 'rc from append at end = 'rc
rc = dropglobal(temp_token)
END
RETURN 0 |