Skip to main content
InSource Solutions

TN AppSvr168 Change the size of an Application Server array at runtime

insource logo large.jpg



This article from InSource shows how to Change the size of an Application Server array at runtime.


  • Author: Mike Viteri
  • Published: 11/13/2015
  • Applies to: Application Server 3.0 & Later





In this example we have a user defined object called "myarray" with a UDA array called "array". "Array" is set as a string with four elements. 




Next we will create a UDA called "arraysize". This is an integer that is user writeable and will allow us to change the array element size at runtime. 




Now we will create a datachange script called "ArrayResize". This datachange script will look at arraysize. Once the integer value for arraysize is changed it will change the element size of the array. This will be done by using the Dimension1 property of the array. This property is not user writeable so a script is needed to modify the value.




We can see the UDAs in the object viewer below. We have a 4 element array size with colors and our array size is equal to four. The "array" and "arraysize" should match during configuration.




Now we can change integer value on "arraysize" and we can see that two extra elements are attached to "array". They are both called default.