Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dynamically add a value to a string array (Script)

Dear community,

I have the following simplified code that set a string array and then browse through all the values.

set vYears = '2008','2009','2010';

for each y in $(vYears)

    blablabla

next;


This is working fine so far, but my question is how could I add the value '2011' to my variable vYears after its first initialization?

Hope you can help me

1 Reply
Anonymous
Not applicable
Author

I managed to find a solution which is the following :

Set vYears = '2008', '2009', '2010';

Set vYears = $(vYears), '2011';

for each y in $(vYears)

    vTest = $(y);

next;


At the end vTest is equal to 2011. It was as simple as that ^^

I let it posted in case it can helps someone else!