V4RB - VTable class constructor oddities

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Sat Aug 22 12:20:22 CDT 2009


On 8/22/09 8:13 PM, "Ernesto Giannotta" <ernestogiannotta at tiscalinet.it>
wrote:

Hi Erne,
Hi Ivan.

> I discovered something very strange.
> 
> If you use the class way to build and open a DB you must NOT call the
> designated super constructor of a VTable.
> 
> If you do so (see it in the Table_Create example) you get 1 empty
> extra table in your DB for every Super.Constructor call in a VTable
> subclass Constructor method.
> 
> Sub Constructor()
>    // Calling the overridden superclass constructor.
>    Super.Constructor( "Person " )
> 
>    mfFirstName = new VString( "fldFirstName", 40 )
>    mfLastName = new VVarChar( "fldLastName", 2000  )
>    mfBornDate = new VDate( "fldBornDate" )
> 
> End Sub
> 
> if you do so you get 2 Tables in the DB
> 1 called Person with all the correct fields
> and 1 empty called table_3
> 
> to make it work correctly you must do;
> 
> Sub Constructor()
>    // DON'T CALL the overridden superclass constructor.
>    //Super.Constructor( "Person " )
> 
>    self.Name = "Person"  // set the name here!
> 
>    mfFirstName = new VString( "fldFirstName", 40 )
>    mfLastName = new VVarChar( "fldLastName", 2000  )
>    mfBornDate = new VDate( "fldBornDate" )
> 
> End Sub
> 
> 
> It looks like a bug, doesn't it?

Yes indeed, because our code of example ...

Please report to mantis.
We will check it


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list