I'm writing an address processing app in C#, using an ActiveX
component (Addr) written in VB6, for which I have the source code. The
main function is FixAddress, which takes a string representing the
address to process (as tab separated fields) and returns a validated
and "standardized" address as a (tab separated) string of address
fields. Here is the code that's driving me nuts (minus a lot of
parsing/error checking stuff):
//******** begin ***********
string inputAddr;
string outputAddr;
string allAddr; // all addresses, separated by "\n"
//Block 1
inputAddr = "415 N Western\t#4\tChicago\tIL\t60625";
outputAddr = Addr.FixAddress(inputAddr);
allAddr = outputAddr + "\n";
//Block 2
inputAddr = "235 East Fullerton\tApt 111\tMiami\tFL\t33174";
outputAddr = Addr.FixAddress(inputAddr);
allAddr = allAddr + outputAddr + "\n";
//********* end ************
Looks pretty simple, but when I run it, allAddr only has the value
assigned in Block 1, minus the newline. When I step through the code,
I can see the variable outputAddr in Block 2 set to the right value,
but, again, the concatenation does NOT work, allAddr is unchanged. I
have even tried something like allAddr = allAddr + "XXX"; but even in
that case allAddr remains unchanged.
WHAT IS GOING ON? Is there something about strings returned from an
unmanaged app that makes them behave like this?
help...
Sam