Can someone please help me?
I am using the Split and Join functions of VB6 to change a string to an array and then back to a string. A string is used because that is what gets stored in a database table or the registry. I get the string from the Dband loop through the values. This technique is great because you do not have to make alot of fields, or keys, for something simple, that has alot of elements, and, ESP., if the number of elements vary. I considered using a collection but I doubt ifit is just as fast, and it would need more code, and a slower loop in order to break the string apart and add the elements to the collection.
In most cases the functions work fine, meet my needs, and are easy to work with,. The problem arises when I use the functions on a string where the NUMBER of elements change, (an item is removed from the list). Then I cannot use the Join function because an empty element gets added.
(The code example will follow the question as a comment because of size limitation – I wanted to give as much detail as possible)
QUESTION:
Who knows of a way to correct the above problem, or a different, more efficient way of doing this at all?
It MUST be easy to work with AND at least as fast as the way I have done it above. Please note that the list could have many elements in it, so a bunch of variables and loops are useless to me. The solution must run with code only, (no objects like a list box, or whatever.)