here in the image attached , i am dynamically adding a string to the string array and this error pops up. can someone help.
1.intLoop is the counter and starts with 0 .
2. when am assigining directly the error does not pop up like ( strArrayName(0) = "hi)
but this error pops up when i write code like
strArrayName(intLoop) = string
Because you haven’t mentioned your array size.
If you are not sure on the size of the collection, best is to go with list !
In you case List is the best option than array. if you are still going to use array then you need to initialise the size of the array. Otherwise you will get the the outside of bounds error.
@Nandhini_Vishnu 10 represents the count which defines maximum number of sub strings to return. That means when it is returning the value it is trying to store these 10 sub strings in different array index (Ex: Arr = FirstSubString, Arr = Second Substring etc). But you were trying to assign all these in an array of index 0. That could cause the issue. try the below one and share the results
Remove intLoop then exp should be
strArrayName=Split(strName, " ")(10)
See if it giving the same exception this case
thanks , its working .
thanks a ton.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.