私が経験している興味深い問題。
文字列の分割から作成された配列を反復処理します。繰り返しながら、配列内の項目に変更を加えます。(アイテムに文字を追加します(文字列、これに関して)
変更は for ループ内で影響を受けますが、この配列を for ループの直後に使用すると、変更が「削除」されたように見え、元の配列が変更前と同様に使用されます。
おそらくbyRef、byValの問題です...しかし、特にどこにも渡していません。
誰かがこの行動に光を当てることができるかもしれません。それ以来、for ループ内にリストを作成し、文字列を変更するたびにリストに追加しました。次に、select ステートメントでリストを使用します。これは機能しますが、配列が変更をドロップする理由について興味があります。
よろしく
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]")