Forum Discussion
Robert_Reznicek
Nimbostratus
Apr 15, 2010Assigning array to another array
Hello, is it somehow possible to fill one array (temporary) and then assign this whole array to another array? I would need to do something like this:
set tempArr(x1) "valueA"
set tempArr(x2) "va...
Hi Robert,
Are you wanting to copy an array to another array? If so, something like this should work:
Create a new array with keys 1 and 2
% array set array1 {key1 val1 key2 val2}
Dump the array contents
% array get array1
key1 val1 key2 val2
Get the array size
% array size array1
2
Create a new array with the contents of $array1
% array set array2 [array get array1]
Dump the array contents
% array get array2
key1 val1 key2 val2
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects