As per the Subject, that is what I want to do.
I am experimenting here, so I know the code is not perfect & may not even work at all, but I am working on it bit by bit and at the moment I just need to get the Index value into the Function
I have a Loop as follows ...
For Ix = 0 To myArrayLen - 1
If myXml1.Value.Chars(Ix) = "Y" Then
myWordData = GetNewsletterHeader(Ix)
MsgBox(myWordData)
End If
Next
and a Function as follows ...
Function GetNewsletterHeader(ByRef Ix As Int16) As String
Dim myXml2 As XmlTextReader = New XmlTextReader(myDataFolder + "NewsLetter Items.xml")
myItem = "Item" + Ix
Do While (myXml2.Read())
If myXml2.IsStartElement() Then
If myXml2.Name = myItem Then
GetNewsletterHeader = myXml2.Value.ToString
End If
End If
Loop
End Function
It currently throws an exception
"Conversion from string "Item" to type 'Double' is not valid.", presumably because the Ix is a pointer rather than a real value.