From - Mon Nov 16 10:49:20 1998 Message-ID: <36506234.1DC7EC77@ibm.net> Date: Mon, 16 Nov 1998 10:34:44 -0700 From: "Jack J. Woehr" Reply-To: jwoehr@ibm.net Organization: Jax RCFB X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.0.34 i586) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.rexx Subject: Re: How to pass an array to a function? References: <364a006e.34328@204.97.16.5> <364ae895.1104419371@newshost.unx.sas.com> <364F7D2A.C8A24501@acepia.net.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 32.100.144.251 X-Trace: 16 Nov 1998 17:34:17 GMT, 32.100.144.251 Lines: 46 X-Notice: Items posted that violate the IBM.NET Acceptable Use Policy X-Notice: should be reported to postmaster@ibm.net X-Complaints-To: postmaster@ibm.net Path: news3.ibm.net!32.100.144.251 Xref: news3.ibm.net comp.lang.rexx:20616 Stan Irish wrote: > > /* sample for a general routine to work on compound variables */ Stan, the technique I use recognizes the useful content-addressable memory nature of stems yet affords a method of iterating "over" stems. /*REXX*/ /* Here you can walk through DogBreeds.1 (if DogBreeds.0 > 0) to */ /* DogBreeds.(DogBreeds.0) getting the keys for every value in the stem. */ DogBreeds.='' DogBreeds.0 = 0 CALL addBreed peke "expensive rug rat" CALL addBreed huskie "eats your cat" if DogBreeds.0 > 0 then do i = 1 to DogBreeds.0 key = DogBreeds.i value = DogBreeds.key SAY key value end return 0 /* Add indexable key-value pair to stem */ addBreed: Procedure expose DogBreeds. Parse arg breed characteristics index = DogBreeds.0 index = index+1 DogBreeds.0 = index DogBreeds.index = breed DogBreeds.breed = characteristics return /* End of Program */ -- Jack J. Woehr # The Drug War is Race War PO Box 51, Golden, CO 80402 # The Drug War is Class War. jwoehr@ibm.net jax@well.com # The Drug War is Civil War. http://www.well.com/~jax/rcfb # Arrest the War on Drugs.