>>>I don't think VFP code can easily be ported into C#, it's quite complex and uses macro substitution.
>>
>>Then make samples of input and output of different data types and values
>>
>>The usual much ado about nothing
>
>I posted the sample several times in this thread. That was sample of input. The output is simple: if I have empty string in the field as input and 0 in numerical column value, they should compare equal.
>
>Rob's solution was perfect and this piece of logic now works great. Unfortunately, a little farther in the logic I still get the famous Invalid cast exception. I started to look at it last night, hope to go to the bottom today.
You should't get to cast exceptions in the first place
(1) make samples of different types and different values in vfp, input and output
(2) Write a ToStringValue() method with overloads, one for each type
string ToStringValue( int value)
if( zero ) return ""
else
...
string ToStringValue( bool value)
string ToStringValue( datetime value)
string ToStringValue( decimal value)
etc
(3) You can now feed the value of the different columns to the ToStringValue() method and compare this value to the value in the Dictionary
It's as simple as that
I'm out of here
Gregory