Question:
An application communicates with a list or file where there are values separated by a character. Example: “value1, value2, value3, value4, …”. How can I access these values individually?
Solution:
In the desired event, use the script below:
Dim charPos, start, option, separator, originalText
Screen.Item(“ComboBox1”).Clear() originalText = Screen.Item(“TextBox1”).Value charPos = 1 Do While charPos < Len(originalText) option = “” if Mid(originalText, charPos, 1) = separator Then charPos = charPos + 1 if charPos = Len(originalText) Then if option <> “” Then |
To see this code commented and fully functional, download the sample application attached to this article.