View previous topic :: View next topic
|
Author |
Message |
aditi panse
New User
Joined: 19 May 2009 Posts: 9 Location: Poona
|
|
|
|
Is ARRAY concept available in CLIST? If yes, what is the SYNTAX for the same. Thanks. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
I'm not a CLIST developer but, out of curiosity, a little search says this:
Quote: |
'Array' is actually a foreign concept to CLIST. Building, maintaining, and handling an array in CLIST is a horrible chore for novices, and isn't much better for the old hands. The number-one problem is resolving the real name of the pseudo-array variable:
SET &ARRAY = &STR(&&ARRAY)
SET &INDEX = 1
SET &ARRAY&INDEX = &STR(THIS IS THE FIRST LINE)
The index must be separately maintained or be algorythmically reproducible in order to fetch the value later, each such element must be separately initialized, and the index value must have the appearance of a single token.
REXX, on the other hand, has 'associative array' as a native concept. That is, a REXX stem array can be indexed by any value: numbers, letters, words, sentences, anything:
ary. = '' /* initializes all ary.x empty */
indexval = "I have two blanks in a row"
ary.indexval = Length(indexval)
The stem array ARY. now has an element indexed by "I have two blanks in a row" which has a value of 27 (the length of "I have two blanks in a row"). The possibilities are endless.
drop ary. /* frees all storage associated with ary.x */ |
|
|
Back to top |
|
|
aditi panse
New User
Joined: 19 May 2009 Posts: 9 Location: Poona
|
|
|
|
Thanks Anuj, really helped me a lot... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
You're welcome, hope you are making progress . . . |
|
Back to top |
|
|
aditi panse
New User
Joined: 19 May 2009 Posts: 9 Location: Poona
|
|
|
|
Hi Anuj,
Thanks for your previous reply. I have used compound variable as array.
I am trying to send values in this variable to another CLIST (using nested CLIST). I have used PROC statement to pass the values. However I am not able to pass the values properly, each time I call another CLIST program asks for POSITIONAL PARAMETER.
Please could you let me know how I can send variable value directly to the CLIST.
I hope my query is clear.
Thanks,
Aditi |
|
Back to top |
|
|
|