Append To String

Hi All

I would like to know if i could append values to a string. I have a code that loops trough an array and gets value on certain positions. but i want to have those values appended to a string so i can then use that as a password.

:for i from 1 to $lengh do={

:global index;
:local new [ :pick $possiblestring ($i+$index) ] ;
:set index ($i+$index+2);
:log error " Output $new";
}

That prints something like

Output v
Output K
Output 3
Output D

I would like to have a string that contains all the outputs. something like :
:local result vK3D

how can i archieve that?

A. :global index could be moved before :for loop
B. declare new as local before :for loop to keep its value across all loop runs
C. initialize new to empty string
D. when you pick random letter then you should append it to new variable instead replacing old value with the new one so use
:set new ( $new . [ :pick $possiblestring ($i+$index) ] )

Many thanks it worked.