0
配列「UIDList()」に割り当てられた値を取得するには、以下のコードがあります。しかし、これまでの理由のために、それは最後の価値しか得ていない。間違っていた可能性のあるものを修正してください。配列が値を取得しない
Dim strTest As String
Dim strarray() As String
Dim UIDList() As String
Dim intCount As Integer
Dim TotUID As Integer
Set oFS = oFSO.OpenTextFile("C:\Pro\test.txt")
txtpro = oFS.ReadAll
strTest = txtpro
strarray = Split(strTest, "=")
For intCount = LBound(strarray()) To UBound(strarray())
If InStr(strarray(intCount), "NAME") Then
UIDList() = Split(strarray(intCount), "NAME")
End If
Next
For TotUID = LBound(UIDList()) To UBound(UIDList())
Debug.Print UIDList(TotUID)
Next
は、UBound関数(UIDList())にTotUID = LBOUND(UIDList())のためにラインで "スクリプト範囲外" エラーを取得 – user3323922
配列が初期化されているかどうかを確認する必要があります。更新された回答を参照してください。 – cyboashu
これは機能しますが、次の値が見つかるまで同じデータを印刷し続けます。私はちょうどそれぞれの新しい価値のために一度それを印刷したかった。 – user3323922