# Array name referencing with a variable

**URL:** <https://forum.kirupa.com/t/array-name-referencing-with-a-variable/146628>\
**Category:** Uncategorized\
**Created:** [May 3, 2005, 1:40am UTC](https://forum.kirupa.com/t/array-name-referencing-with-a-variable/146628 "2005-05-03T01:40:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreeft](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@dreeft](https://forum.kirupa.com/u/dreeft)\
**Post date:** [May 3, 2005, 1:40am UTC](https://forum.kirupa.com/t/array-name-referencing-with-a-variable/146628/1 "2005-05-03T01:40:36Z")

</div>

Hey all,

fairly simple question (with a long explaination). I have an array, created from the results of another array and it’s position in that array. There are actually multiple arrays It can be created from.

Eg.  
Array1: clientName1, clientName2, etc.  
Array2: clientType1, clientType2, etc.  
Second Array: [clientName1,0], [clientName2,1] **OR** [clientType1,0] etc.

The code for creating the second array is below:

```auto

for (i=0; i<names.length; i++) {
linkArray* = [**names*** , i];
}

```

My issue is, I would like to be able to dynamically adjust the array that it is generating from. This would mean changing the bold bit of the code above.

I have tried declaring a variable (type = names+"\*") and using it in the linkArray declaration, however it will not see this as an array reference, only as a variable.

What I want to know is, how do I reference the name of the original array as a variable so I can update it dynamically?
