|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Thu Jun 17, 2004 6:31 pm
Best way to get the count number in Variable |
I have a variable that holds a number of values:
#var imput bread|eggs|milk|sausage|butter
What I want to do is be about to list the items by count number:
This output:
You have bread in @input.1
You have eggs in @input.2
You have milk in @input.3
You have sausage in @input.4
You have butter in @input.5
I tried a #FORALL @input {}, but I can't get it to count the list items. correctly because that forall is inside another forall. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Thu Jun 17, 2004 7:53 pm |
Use %i for the first Loop/forall use %j for the first nested one and use %k for the second nested etc.
Also for future refrence it sometimes helps to post the script that you have so we know exactly what you are trying to do and quite possibly give you pointers on how to make it better. |
|
|
|
|
|