The problem is not with BCB but with how C++ handles strings. Off the top of my head I can think of two ways but neither is very eligent. One is to use the
Pos() method. For example, if there are three spaces between each item in the string then
Code:
int SpacePlace = TString1->Strings.Pos(" ");
will return the first position of the three spaces. If it returns -1 then the 3 spaces do not exist.
You could then split the string into two string using something like
SubString. (If you didn't know how many spaces are between each item, you could just search for one string, take the substring, then use
Trim to clean up any leading and trailing spaces.)
You could repeat this procedure until you get a -1 indicating that there are no more items left.
Another way that I haven't tested is to send the
TString to a stream and use the stream's ability to seperate variables using whitespace.
TString has a method that will take it to a stream and back.
I just thought of a third way. If you convert the
TString into a C++ string, you could use
getline to split the string into parts. This would avoid splitting the string into parts. I use this alot. I don't know why I didn't think of it earlier. James P. Cottingham
I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.