A lot of stupid questions lately, but I would appreciate some material on this. I have a line that comes from an INI file. It looks like Firstname=FIRSTNAME . It is basically an array with many of them. I want to smash them, but keep them both. So, I managed to put Firstname in my own array and Firstname in it own. But then my colleague said: "Why don't you just use a multidimensional array?" And that made me think, putting Firstname at 0 and Firstname at 1. But how to do it?
This is my code right now:
For iTeller = 0 To UBound(arrIniName) If Not arrIniName(iTeller) = "" Then arrIniName(iTeller) = Split(arrIniName(iTeller), "=")(0) End If Next For iTeller = 0 To UBound(arrIniValue) If Not arrIniValue(iTeller) = "" Then arrIniValue(iTeller) = Split(arrIniValue(iTeller), "=")(1) End If Next
Both the arrIniName and arrIniValues ββattributes consist of the same array to start with. Which looks like this:
arrIniName(0) "Fistname=FIRSTNAME" arrIniName(1) "Lastname=LASTNAME" arrIniName(2) "Initials=INITIALS"
Therefore, I basically split each into its own arrays as I am doing it now. But perhaps it would be better to place them in a multidimensional array? Because then I will have only one array to control, and also pull this array through a For Each loop.
Edit: I ended this up where Values is an array
For Each s In Values Dim strName, strValue s = Split(s, "=") strName = s(0) strValue = s(1) 'Run function strName, strValue Next
source share