Vtable.FieldCount problem was: Illegal Cast Exception
Steve Albin
steve at steve-albin.com
Sat Oct 17 07:36:13 CDT 2009
On 10/17/09 at 3:59 AM, ruslan_zasukhin at valentina-db.com (Ruslan
Zasukhin) wrote:
>>I just upgraded to V4RB 4.3 from 4.1. Without changing anything
>>in my project, I built the Mac version and ran. I'm getting
>>Illegal Cast Exceptions on VarChar fields in lots of places
>>where I use an index as so:
>>return cursor.VarCharField(templateFieldCount+2).value
>>and like this:
>
>*********************
>>return VVarChar(cursor.Field(nTplPersonnelFldOffset+1)).GetString
>
>Why you write it in such way?
>I'd write it as
>return cursor.VarCharField(nTplPersonnelFldOffset+1).GetString
>
>Even better. GetString is method of VField. Right?
>Then why to ask for VarChar ?
>It is enough
>
>return cursor.Field(nTplPersonnelFldOffset+1).GetString
>
>
>
Hi Ruslan,
Yes, I agree that some of my code is poorly written. Some of it
goes back to Valentina 1. I am updating my code to improve it
as I go along. But this isn't the problem I have now. In my
follow up email, I mentioned that the problem was the result of
an incorrect result returned by VTable.FieldCount. What about that?
My project worked fine using V4RB 4.1. I changed nothing but
installed V4RB 4.3 and rebuilt the project. Why would
FieldCount work in 4.1 and not in 4.3? I see nothing in release
notes mentioning a change to FieldCount.
I will create a small project and submit to Mantis.
Steve
--
Steve Albin - Montclair, NJ
http://www.jazzdiscography.com/
http://www.steve-albin.com/
More information about the Valentina
mailing list