Guidance
指路人
g.yi.org
Upload / Forum Attachment / Reginald Rexx Programming Language Compiler User Forum Attachments and Pictures / 13076-copyglobal.rex

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
/* */
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     /* BY default, we'll be inserting "in the middle" of the to_array */

IF into = "" THEN
	into = 1 

IF into >= hi_to THEN	
	sw_insert = 0      /* Appending to end of to_array */


IF sw_insert = 1 THEN
	DO
		/* Save the "trailing" part of the to_array */ 
		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
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-10-12  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2009-07-15 08:45:06