Curious issue I am experiencing.
I iterate through an array that was created from a string split. On iteration, I make modifications to the items in the array. (Add characters to the item (string, in this regard)
The changes are affected IN the for loop, but when using this array directly after the for loop, the changes seems to be "dropped", and the original array, as before the changes, is used.
It is probably a byRef, byVal issue... but I am not specifically passing it anywhere.
Maybe someone can shed some light on this behavior. I have since built a list inside the for loop, and add to it as I make the string changes. I then use the list in my select statement. This works, but I am curious as to why the array drops its changes.
Regards
Dim descriptionSplit() As String
descriptionSplit = Split(unit.itemDescription, "[")
'add the cut "[" back to the strings . "[" was cut from the strings when it was split ON "["
For Each splitSection As String In descriptionSplit.
'add back the '[' char
splitSection = "[" & splitSection
Debug.Print(splitSection)
Next
'look for and find TAGS
For Each splitSection As String In descriptionSplit
Select Case True
'Look for #UNIT# TAG
'######## HERE, the array has reverted to the original copy....
Case splitSection.Contains("[U]")