M
Martn Camern
I have an aray of keys for an INI file:
iniarray = Array("AgentsName", "AfterHours", "CellPhone", "Fax", "Email")
I iterate through the file as follows:
For x = 0 To 4
strvalue = System.PrivateProfileString(FileName, "MySectionName",
iniarray(x))
' Place strvalue in the form feild iniarray(x).Value
iniarray(x).Text = strvalue
next x
Simple!
However, it doesn't work. I have to do this:
For x = 0 To 4
strvalue = System.PrivateProfileString(FileName, "MySectionName",
iniarray(x))
If (iniarray(x) = "AgentsName") Then
fieldValue.Result = strvalue
'AgentsName.Value = strvalue
ElseIf (iniarray(x) = "AfterHours") Then
AfterHours.Value = strvalue
ElseIf (iniarray(x) = "CellPhone") Then
Cell.Value = strvalue
ElseIf (iniarray(x) = "Fax") Then
Fax.Value = strvalue
ElseIf (iniarray(x) = "Email") Then
Email.Value = strvalue
End If
next x
What is the solution.
If I do MsgBox(iniarray(x)) I get the string name of the textbox!
iniarray = Array("AgentsName", "AfterHours", "CellPhone", "Fax", "Email")
I iterate through the file as follows:
For x = 0 To 4
strvalue = System.PrivateProfileString(FileName, "MySectionName",
iniarray(x))
' Place strvalue in the form feild iniarray(x).Value
iniarray(x).Text = strvalue
next x
Simple!
However, it doesn't work. I have to do this:
For x = 0 To 4
strvalue = System.PrivateProfileString(FileName, "MySectionName",
iniarray(x))
If (iniarray(x) = "AgentsName") Then
fieldValue.Result = strvalue
'AgentsName.Value = strvalue
ElseIf (iniarray(x) = "AfterHours") Then
AfterHours.Value = strvalue
ElseIf (iniarray(x) = "CellPhone") Then
Cell.Value = strvalue
ElseIf (iniarray(x) = "Fax") Then
Fax.Value = strvalue
ElseIf (iniarray(x) = "Email") Then
Email.Value = strvalue
End If
next x
What is the solution.
If I do MsgBox(iniarray(x)) I get the string name of the textbox!