|
|
 | | From: | Vitonis, Anthony J | | Subject: | Re: Calling function with variable name -- security | | Date: | 19 Jan 2005 09:38:35 -0800 |
|
|
 | I would, as follows. (The stem to be sorted must have a count in the .0 element, and the .1 thru .n elements must contain the data to be sorted.)
-----
Calling exec:
/* REXX */
INTERPRET SORTSTEM("Data")
-----
Called exec (SORTSTEM):
/* REXX */
PARSE ARG Name, Comparison IF Comparison \= "<" THEN Comparison = ">"
RETURN "IF "Name".0 > 1 THEN ;", "DO ;", "$$_Gap = "Name".0 ;", "DO UNTIL \$$_Swapped & ($$_Gap = 1) ;", "$$_Gap = MAX(($$_Gap / 1.3) % 1, 1) ;", "$$_Swapped = (1=0) ;", "DO $$_i = 1 TO "Name".0 - $$_Gap ;", "$$_j = $$_i + $$_Gap ;", "IF" Name".$$_i" Comparison Name".$$_j THEN ;", "DO ;", "$$_Hold = "Name".$$_i ;", Name".$$_i = "Name".$$_j ;", Name".$$_j = $$_Hold ;", "$$_Swapped = (1=1) ;", "END ;", "END ;", "END ;", "DROP $$_Gap $$_Swapped $$_i $$_j $$_Hold ;", "END"
> From: Bob Bridges > Subject: Re: Calling function with variable name -- security > > ...who would write INTERPRET into a production program anyway?
---------------------------------------------------------------------- For TSO-REXX subscribe / signoff / archive access instructions, send email to LISTSERV@VM.MARIST.EDU with the message: INFO TSO-REXX
|
|
|