Adding to a string array alphabetically - arrays

I'm looking for a way to add a string (from a cell) to a string array alphabetically.
For instance:
string array = {"apple", "banana", "orange"}
add "cherry":
string array = {"apple", "banana", "cherry", "orange"}
Hence if I do sheets(1).range("A1").value = new string array, the entire array will be in one cell.
I found a function online that sorts selected cells alphabetically, but not sure if it helps in my instance.
Function Alphabetize(vStrings As Variant, separator As String) As String
Dim v As Variant, vSorted As Variant
Dim i As Long, j As Long, n As Long
Dim bDone As Boolean
For Each v In vStrings
n = n + 1
Next
ReDim vSorted(1 To n)
ReDim pos(1 To n)
For Each v In vStrings
i = i + 1
vSorted(i) = v
Next
For j = 2 To n
bDone = True
For i = 2 To n
If vSorted(i) < vSorted(i - 1) Then
v = vSorted(i - 1)
vSorted(i - 1) = vSorted(i)
vSorted(i) = v
bDone = False
End If
Next
If bDone Then Exit For
Next
For i = 1 To n
If vSorted(i) <> "" Then
If i = 1 Then
Alphabetize = separator & vSorted(i)
Else
If vSorted(i) <> vSorted(i - 1) Then Alphabetize = Alphabetize & separator & vSorted(i)
End If
End If
Next
Alphabetize = Mid$(Alphabetize, 2)
End Function

You can use the System.Collections.SortedList class from the .NET library, if you want. Then there's no need to worry about sorting.
Dim objList As Object
Set objList = CreateObject("System.Collections.SortedList")
objList.Add "apple", ""
objList.Add "banana", ""
objList.Add "orange", ""
objList.Add "cherry", ""
Dim i As Long
For i = 0 To objList.Count - 1
Debug.Print objList.GetKey(i)
Next
Prints:
apple
banana
cherry
orange
If you want to combine the values into a string, just concatenate them as you loop through the values or you can transfer to an array and use Join to create the string:
ReDim a(objList.Count - 1) As String
Dim i As Long
For i = 0 To objList.Count - 1
a(i) = objList.GetKey(i)
Next
' Combine strings into the format: {"string1", "string2", "stringN"}
Sheet1.Range("A1").Value = "{""" & Join(a, """, """) & """}"

It isn't clear where the declaration or assignment of vStrings and 'cherry' are but here is a sub calling the function that appends the array and returns a delimited list (single text value) to Sheet1's A1.
Sub main()
Dim string_array As Variant, new_string As String
string_array = Array("apple", "banana", "orange")
new_string = "cherry"
Sheets(1).Range("A1").Value = add_and_alphabetize(string_array, new_string, sDELIM:=Chr(44))
End Sub
Function add_and_alphabetize(vSTR As Variant, sSTR As String, _
Optional sDELIM As String = ";", Optional bDESC As Boolean = False)
Dim i As Long, j As Long, vTMP As Variant
If CBool(Len(sSTR)) Then
ReDim Preserve vSTR(LBound(vSTR) To UBound(vSTR) + 1)
vSTR(UBound(vSTR)) = sSTR
End If
For i = LBound(vSTR) To UBound(vSTR) - 1
For j = i To UBound(vSTR)
If (vSTR(i) < vSTR(j) And bDESC) Or (vSTR(i) > vSTR(j) And Not bDESC) Then
vTMP = vSTR(j)
vSTR(j) = vSTR(i)
vSTR(i) = vTMP
End If
Next j
Next i
add_and_alphabetize = Join(vSTR, sDELIM)
End Function
I've added options to specify the delimiter character (defaulted as a semi-colon) and change the order of the sort.

Related

Better solution to find and return duplicates in an array - VBA

I am trying to develop a function that will take an array of results containing duplicate values and return an array containing only the duplicated values. The code below does work but I wonder if there is a more elegant / shorter solution?
Sub test()
Dim allFruits(9) As String, manyFruits() As String
allFruits(0) = "plum"
allFruits(1) = "apple"
allFruits(2) = "orange"
allFruits(3) = "banana"
allFruits(4) = "melon"
allFruits(5) = "plum"
allFruits(6) = "kiwi"
allFruits(7) = "nectarine"
allFruits(8) = "apple"
allFruits(9) = "grapes"
manyFruits = duplicates(allFruits())
End Sub
Function duplicates(allFound() As String)
Dim myFound() As String
Dim i As Integer, e As Integer, c As Integer, x As Integer
Dim Comp1 As String, Comp2 As String
Dim found As Boolean
If Len(Join(allFound)) > 0 Then 'Check string array initialised
If UBound(allFound) > 0 Then
For c = 0 To UBound(allFound) 'Pass ONLY the duplicates
Comp1 = allFound(c)
If Comp1 > "" Then
For x = c + 1 To UBound(allFound)
Comp2 = allFound(x)
If Comp1 = Comp2 Then
found = True
ReDim Preserve myFound(0 To i)
myFound(i) = Comp1
i = i + 1
For e = x To UBound(allFound) 'Delete forward instances of found item
If allFound(e) = Comp1 Then
allFound(e) = ""
End If
Next e
Exit For
End If
Next x
End If
Next c
Else 'Just one found
ReDim myFound(0 To 0)
myFound(0) = allFound(0)
found = True
End If
End If
duplicates = myFound
End Function
Double Dictionary
As String (Exactly the Same Functionality)
Sub test1()
Dim allFruits(9) As String, manyFruits() As String
allFruits(0) = "plum"
allFruits(1) = "apple"
allFruits(2) = "orange"
allFruits(3) = "banana"
allFruits(4) = "melon"
allFruits(5) = "plum"
allFruits(6) = "kiwi"
allFruits(7) = "nectarine"
allFruits(8) = "apple"
allFruits(9) = "grapes"
manyFruits = Duplicates1(allFruits())
Debug.Print Join(manyFruits, vbLf)
End Sub
Function Duplicates1(StringArray() As String) As String()
Dim sDict As Object: Set sDict = CreateObject("Scripting.Dictionary")
sDict.CompareMode = vbTextCompare
Dim dDict As Object: Set dDict = CreateObject("Scripting.Dictionary")
dDict.CompareMode = vbTextCompare
Dim n As Long
For n = LBound(StringArray) To UBound(StringArray)
If sDict.Exists(StringArray(n)) Then
dDict(StringArray(n)) = Empty
Else
sDict(StringArray(n)) = Empty
End If
Next n
If dDict.Count = 0 Then Exit Function
Set sDict = Nothing
Dim arr() As String: ReDim arr(0 To dDict.Count - 1)
Dim Key As Variant
n = 0
For Each Key In dDict.Keys
arr(n) = Key
n = n + 1
Next Key
Duplicates1 = arr
End Function
As Variant (Shorter But Different see ' ***)
Sub test2()
Dim allFruits(9) As String, manyFruits() As Variant ' *** here
allFruits(0) = "plum"
allFruits(1) = "apple"
allFruits(2) = "orange"
allFruits(3) = "banana"
allFruits(4) = "melon"
allFruits(5) = "plum"
allFruits(6) = "kiwi"
allFruits(7) = "nectarine"
allFruits(8) = "apple"
allFruits(9) = "grapes"
manyFruits = Duplicates2(allFruits())
Debug.Print Join(manyFruits, vbLf)
End Sub
Function Duplicates2(StringArray() As String) As Variant ' *** here
Dim sDict As Object: Set sDict = CreateObject("Scripting.Dictionary")
sDict.CompareMode = vbTextCompare
Dim dDict As Object: Set dDict = CreateObject("Scripting.Dictionary")
dDict.CompareMode = vbTextCompare
Dim n As Long
For n = LBound(StringArray) To UBound(StringArray)
If sDict.Exists(StringArray(n)) Then
dDict(StringArray(n)) = Empty
Else
sDict(StringArray(n)) = Empty
End If
Next n
Duplicates2 = dDict.Keys
End Function
Short approach via FilterXML()
This approach
transforms the base array allFruits into a wellformed xml content using name attributes (nm) and
applies an XPath expression upon all nodes filtering only nodes with siblings via
"fruits/fruit[(#nm = following-sibling::fruit/#nm)]/#nm"
Instead of explicitly referring to fruits you could also start XPath with //fruit[..." where the double slashes indicate a search at any hierarchy level.
Function MoreThanOne(arr)
'Purp: get only fruits with multiple occurrencies
'Note: reads top to bottom returning the last(!) attribute #nm
' based on the condition of no following fruit sibling,
'a) create a wellformed xml content string
Dim content As String
content = _
"<fruits><fruit nm='" & _
Join(arr, "'/><fruit nm='") & _
"'/></fruits>"
'b) define XPath expression
Dim XPth As String
XPth = "/fruits/fruit[(#nm = following-sibling::fruit/#nm)]/#nm" ' multiple occurrencies
'c) apply FilterXML function
Dim x: x = Application.FilterXML(content, XPth)
'd) return result(s)
MoreThanOne = Application.Transpose(x)
Select Case VarType(x)
Case vbError
MoreThanOne = Array("Nothing found")
Case vbString
MoreThanOne = Array(x)
Case Else
MoreThanOne = Application.Transpose(x)
End Select
End Function
Example call
Sub testMoreThanOne()
Dim allFruits(9) As String, manyFruits() As Variant
allFruits(0) = "plum"
allFruits(1) = "apple"
allFruits(2) = "orange"
allFruits(3) = "banana"
allFruits(4) = "melon"
allFruits(5) = "plum"
allFruits(6) = "kiwi"
allFruits(7) = "nectarine"
allFruits(8) = "apple"
allFruits(9) = "grapes"
manyFruits = MoreThanOne(allFruits)
Debug.Print Join(manyFruits, vbLf) ' ~~> plum|apple
End Sub
Schema of the created xml structure by above array joins
<fruits>
<fruit nm='plum'/>
<fruit nm='apple'/>
<fruit nm='orange'/>
<fruit nm='banana'/>
<fruit nm='melon'/>
<fruit nm='plum'/>
<fruit nm='kiwi'/>
<fruit nm='nectarine'/>
<fruit nm='apple'/>
<fruit nm='grapes'/>
</fruits>
Side note
Of course you might want to get just uniques by only negating the XPath condition in brackets via
XPth = "/fruits/fruit[not(#nm = following-sibling::fruit/#nm)]/#nm"
My solution...
Sub FindDuplicates()
Dim VarDat As Variant
Dim lngz As Long, lngz2 As Long, lngF As Long
Dim objDict As Object
Dim b As Boolean
With Sheet1
Set objDict = CreateObject("Scripting.Dictionary")
VarDat = .Range("A1:A20").Value2
For lngz = 1 To UBound(VarDat, 1)
For lngz2 = lngz + 1 To UBound(VarDat, 1)
If VarDat(lngz, 1) = VarDat(lngz2, 1) Then
b = True
Exit For
End If
Next lngz2
If b = True Then
If objDict.Exists(VarDat(lngz, 1)) = False Then
objDict.Add VarDat(lngz, 1), 0
End If
b = False
End If
Next lngz
.Range("D:D").Clear
.Range("D1:D" & objDict.Count) = Application.Transpose(objDict.keys)
End With
End Sub

VBA - Remove duplicate values of an array

I want to remove the duplicated values of an sorted array.
Here is the code to sort the values in ascending order.
Dim k As Integer
Dim j As Integer
Dim sortedArray As Variant
Dim sorting As Boolean
If sorting = True Then
For j = LBound(concentrationArray) To UBound(concentrationArray)
For k = j + 1 To UBound(concentrationArray)
If concentrationArray(j) < concentrationArray(k) Then
sortedArray = concentrationArray(j)
concentrationArray(j) = concentrationArray(k)
concentrationArray(k) = sortedArray
End If
Next k
Next j
ElseIf sorting = False Then
For j = LBound(concentrationArray) To UBound(concentrationArray)
For k = j + 1 To UBound(concentrationArray)
If concentrationArray(j) > concentrationArray(k) Then
sortedArray = concentrationArray(k)
concentrationArray(k) = concentrationArray(j)
concentrationArray(j) = sortedArray
End If
Next k
Next j
End If
However, from these sorted array, they may contain repeated values which I want to remove them.
For j = LBound(concentrationArray) To UBound(concentrationArray)
For k = j + 1 To UBound(concentrationArray)
If concentrationArray(j) <> concentrationArray(k) Then
sortedArray = concentrationArray(j)
concentrationArray(j) = concentrationArray(k)
concentrationArray(k) = sortedArray
ElseIf concentrationArray(j) = concentrationArray(k) Then
sortedArray = concentrationArray(j)
concentrationArray(j) = concentrationArray(k + 1)
ReDim concentrationArray(LBound(concentrationArray) To UBound(concentrationArray) - 1) As Variant
concentrationArray(k) = sortedArray
End If
Next k
Next j
I don't understand why this returns error.
Can anyone help?
Thanks in advance
--------------------------SOLVED--------------------------
Here it is another way to make it work:
j = LBound(concentrationArray)
While j < UBound(concentrationArray)
If concentrationArray(j) = concentrationArray(j+1) Then
Call DeleteElementArray(j, concentrationArray)
End If
j = j + 1
Wend
Public Sub DeleteElementArray(ByVal arrIndex as Integer, ByRef myArr as Variant)
Dim p as Long
For p = arrIndex+1 To Ubound(myArr)
myArr(p-1) = myArr(p)
Next p
Use this simple trick to make a 1D array unique:
Function Unique(aFirstArray() As Variant)
'Collections can be unique, as long as you use the second Key argument when adding items.
'Key values must always be unique, and adding an item with an existing Key raises an error:
'hence the On Error Resume Next
Dim coll As New Collection, a
Dim tempArray() As Variant 'aFirstArray(),
Dim i As Long
' aFirstArray() = Array("Banana", "Apple", "Orange", "Tomato", "Apple", _
' "Lemon", "Lime", "Lime", "Apple")
On Error Resume Next
For Each a In aFirstArray
'Debug.Print a
coll.Add a, a
Next
ReDim aFirstArray(coll.count)
For i = 1 To coll.count
'Cells(i, 1) = coll(i)
aFirstArray(i) = coll(i)
Next
End Function
As your data is already sorted you could also use an ArrayList object and then extract all items in one go with .toArray. You can use .Contains method to add only unique items.
Option Explicit
Public Sub DeDuplicateArray()
Dim sortedArray(), i As Long, sList As Object, arr()
sortedArray = Array(0, 0, 1, 2, 2, 3)
Set sList = CreateObject("System.Collections.ArrayList")
For i = LBound(sortedArray) To UBound(sortedArray)
If Not sList.contains(sortedArray(i)) Then sList.Add sortedArray(i)
Next
arr = sList.toArray
Debug.Print UBound(arr)
End Sub
If data wasn't sorted you could add to a SortedList object, using a test of .Contains to exclude duplicates.
Option Explicit
Public Sub DeDuplicateArray()
Dim sortedArray(), i As Long, sList As Object
sortedArray = Array(0, 0, 1, 2, 2, 3)
Set sList = CreateObject("System.Collections.SortedList")
For i = LBound(sortedArray) To UBound(sortedArray)
If Not sList.contains(sortedArray(i)) Then sList.Add sortedArray(i), vbNullString
Next
Debug.Print sList.Count
End Sub
try this code please:
Option Explicit
Sub ifDublicate()
Dim i, lRow As Integer
Dim actuellCell, cellInArray As Variant
Dim countValues, deleted As Double
'Dim arr ()
'lRow = ActiveSheet.Range("A" & Range("A:A").Rows.Count).End(xlUp).Row
'arr = Range("A1:A" & lRow)
Dim arr(10) As Variant ' or array from worksheet
arr(0) = "Apple"
arr(1) = "Orange"
arr(2) = "Apple"
arr(3) = "Apple"
arr(4) = "beans"
arr(5) = "beans"
arr(6) = "Orange"
arr(7) = "Orange"
arr(8) = "sandwitch"
arr(9) = "coffee"
arr(10) = "nuts"
For i = 0 To UBound(arr)
actuellCell = arr(i)
If InStr(cellInArray, actuellCell) > 0 Then
' ActiveSheet.Cells(i, 2) = "Already Exists"
deleted = deleted + 1
Else
cellInArray = CStr(cellInArray) & "," & CStr(actuellCell)
countValues = countValues + 1
If Left(cellInArray, 1) = "," Then
cellInArray = Right(cellInArray, Len(cellInArray) - 1)
End If
End If
Next i
MsgBox "Array after remove duplicate: " & cellInArray & vbNewLine & _
"Count Values without duplicate: " & countValues & vbNewLine & _
"deleted: " & deleted & vbNewLine & _
"last value: " & actuellCell
End Sub

VBA Dynamic Array without empty space

I have two arrays: in the first one are names and in the second one there are country codes like this example:
array1(0)="Peter" array2(0)="EN"
array1(1)="John" array2(1)="US"
array1(2)="Sandra" array2(2)="FR"
array1(3)="Margot" array2(3)="DE"
Now, I want to check the from an entry in a textbox1 if its a "FR" available in my arrays,if yes then save the positions in a third new array.
My code looks like this, but it is very bad and it does not work the way I want.
Dim name(0 To 9) As String
array1(0) = "Peter"
array1(1) = "John"
array1(2) = "Sandra"
array1(3) = "Margot"
Dim county(0 To 9)
county(0) = "EN"
county(1) = "US"
county(2) = "FR"
county(3) = "DE"
'Dim ArrayCounter
ArrayCounter = 0
Dim VarArray(9999)
For i = 0 To 9
If county(i) = "DE" Then
'ArrayCounter = ArrayCounter + 1
'MsgBox (array1(i))
VarArray(ArrayCounter) = i
ArrayCounter = ArrayCounter + 1
End If
Next i
MsgBox (UBound(VarArray))
Now, if I check the third array, the array has to look like this:
array3(0)=2 'position of FR in my second array
You can get rid of the empty values in your 0 To 9999 array by redimming it:
If ArrayCounter > 0 Then
ReDim Preserve varArray(0 to ArrayCounter - 1) 'Preserve is important because otherwise it will delete the values
Else
'do what you want to do if no match was found
End If
you may be after the following:
Sub main()
Dim names(0 To 9) As String
names(0) = "Peter"
names(1) = "John"
names(2) = "Sandra"
names(3) = "Margot"
Dim county(0 To 9) As String
county(0) = "EN"
county(1) = "US"
county(2) = "FR"
county(3) = "DE"
Dim ArrayCounter As Long
ArrayCounter = 0
Dim foundArray As Variant
foundArray = county '<--| "copy" the 'county' array into 'foundArray', since this latter won't be bigger than the former
Dim iFound As Long, iCounty As Long
iFound = -1
For iCounty = LBound(county) To UBound(county)
If county(iCounty) = "DE" Then
iFound = iFound + 1 '<-- update the 'foundArray' current counter
foundArray(iFound) = iCounty '<-- update the 'foundArray' current counter content
End If
Next iCounty
If iFound >= 0 Then
ReDim Preserve foundArray(0 To iFound) '<--| if any values have been found, resize 'foundArray' up to the found items counter
Else
Erase foundArray '<--| otherwise erase it
End If
End Sub

Several Arrays within ParamArray

I need a function, which searches some strings within different arrays within one single string.
Let's say, I have the word "building" and two lists (= two arrays):
1. house, garage, tower, castle, building
2. table, bed, flowers, picture
So, in this case list 1 contains the regarding word and should therefore responded.
My code so far (one dimensional array):
Function cbsMatchKeywords(strKeyword As String, ParamArray strList() As Variant) As String
Dim i As Long
For i = LBound(strList,1) + 1 To UBound(strList,1)
If InStr(strKeyword, strList(i,1)) > 0 Then
cbsMatchKeywords = cbsMatchKeywords & strList(i,1)
End If
Next i
End Function
Any ideas?
This will work for you
Function cbsMatchKeywords(strKeyword As String, ParamArray strList() As Variant) As String
Dim i As Long, j As Long
For j = LBound(strList, 2) To UBound(strList, 2)
For i = LBound(strList, 1) + 1 To UBound(strList, 1)
If InStr(strKeyword, strList(i, j)) > 0 Then
cbsMatchKeywords = cbsMatchKeywords & strList(i, j)
End If
Next i
Next j
End Function
Option Explicit
Public Sub Main()
Dim arr1 As Variant
arr1 = Array("house", "garage", "tower", "castle", "building")
Dim arr2 As Variant
arr2 = Array("table", "bed", "flowers", "picture")
Const keyword As String = "building"
Dim result As String
result = cbsMatchKeywords(keyword, arr1, arr2)
Debug.Print "Result is : '" & result & "'"
' Prints:
' Result is : 'building'
End Sub
Function cbsMatchKeywords( _
strKeyword As String, _
ParamArray strList() As Variant) As String
Dim i As Integer
Dim j As Integer
Dim arr As Variant
For i = LBound(strList) To UBound(strList)
arr = strList(i)
If Not IsArray(arr) Then _
GoTo continue
For j = LBound(arr) To UBound(arr)
If InStr(strKeyword, arr(j)) > 0 Then
cbsMatchKeywords = cbsMatchKeywords & arr(j)
End If
Next j
continue:
Next i
End Function

Is it possible to divide a Array in VBA

Is it possible to divide an Array?
Example:
array(2) As String
array(1) = "test1"
array(2) = "test2"
~ Now Split
array1 (contains test1) & array 2 (contains test2)
I want to implement a Binarysearch
You can split like this
Sub split_array()
Dim array1(1 To 2) As String
Dim array2(1 To 2) As String
Dim array3(1 To 2) As String
array1(1) = "Test1"
array1(2) = "Test2"
array2(1) = array1(1)
array3(1) = array1(2)
End Sub
But I suspect that is not the best way to do it. I think you would do much better using 3 (probably long integer) variables to represent positions in the array. 1 to represent the 1st element, 1 to represent the last element and 1 to represent the mid element.
Dim lLowerSearchElement As Long
Dim lUpperSearchElement As Long
Dim lMiddleSearchElement As Long
Dim array1(1 to 999) as string
lLowerSearchElement = 1
lUpperSearchElement = 999
lMiddleSearchElement = (lUpperSearchElement + lLowerSearchElement) / 2
You can then check if the if the element is equal to, greater or less then the middle element and proceed accordingly.
Also remember that you will need to sort your data before attempting to use a binary search and it would be useful if you know about recursive calling.
You also need to test your implementation rigorously as a small mistake could result in the search not working probably.
Edit 22/08/13
The implementation I use for a binary search is given below:
Function bCheckSamplePoint(ByRef lSamplePointArray() As String, ByRef bfound As Boolean, _
ByVal lSamplePoint As String) As Boolean
'byref used for the array as could be slow to keep copying the array, bFound is used by calling procedure
Dim lLowerSearchElement As Long
Dim lUpperSearchElement As Long
Dim lMiddleSearchElement As Long
bfound = False 'False until found
'Set initial limits of the search
lLowerSearchElement = 0
lUpperSearchElement = UBound(lSamplePointArray())
Do While lLowerSearchElement <= lUpperSearchElement And bfound = False
lMiddleSearchElement = (lUpperSearchElement + lLowerSearchElement) / 2
If StrComp(lSamplePointArray(lMiddleSearchElement), lSamplePoint, vbTextCompare) = -1 Then
' 'Must be greater than middle element
lLowerSearchElement = lMiddleSearchElement + 1
ElseIf (lSamplePointArray(lMiddleSearchElement) = lSamplePoint) Then
bfound = True
Else
'must be lower than middle element
lUpperSearchElement = lMiddleSearchElement - 1
End If 'lSamplePointArray(lmiddlesearchlelemnt) < lSamplePoint
Loop 'While lLowerSearchElement <= lUpperSearchElement
ErrorExit:
bCheckSamplePoint = bReturn
Exit Function
As you can see this binary search is only checking to see wether a string is found in an array of strings, but it could be modified for other purposes.
You don't need a split function to do binary search
My VBA version of binary search can be found at
http://fastexcel.wordpress.com/2011/08/02/developing-faster-lookups-part-3-a-binary-search-udf/
Split Array into chunks
Public Function splitArray(ByVal initial_array As Variant, Optional chunk_size As Long = 1) As Variant()
Dim split_array() As Variant
Dim chunk() As Variant
Dim chunk_index As Integer: chunk_index = 0
Dim array_index As Integer: array_index = 1
If UBound(initial_array) > chunk_size Then
For i = 0 To UBound(initial_array)
If (i + 1) / (chunk_size * array_index) = 1 Or i = UBound(initial_array) Then
ReDim Preserve chunk(chunk_index)
chunk(chunk_index) = initial_array(i)
ReDim Preserve split_array(array_index - 1)
split_array(array_index - 1) = chunk
chunk_index = 0
array_index = array_index + 1
Else
ReDim Preserve chunk(chunk_index)
chunk(chunk_index) = initial_array(i)
chunk_index = chunk_index + 1
End If
Next i
splitArray = split_array
Else
ReDim Preserve split_array(0)
split_array(0) = initial_array
splitArray = split_array
End If
End Function

Resources