[ATTN!] Inform us about your show-stoppers bugs in 2.4 betas if any!

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Jul 8 02:14:40 CDT 2006


On 7/7/06 11:23 PM, "Dave Addey" <listmail1 at dsl.pipex.com> wrote:

Hi Dave,

> So how *do* I do this in the class-way?  I did not realise that it was so
> fixed from the docs - and I have not been able to find any way to do this
> safely for the class-way, in any of the docs.  How should I do this?

1) IF you have setup structure of db + tables as classes,
    then you cannot change this


2) only way is described for case, if you need in new version of product
upgrade structure. Then steps are:

Dim db as Vdatabase = new VDatabase

If( db.schemaVersion is old )

    db.open   << not as myDatabase !!

        do API calls like DropTable, CreateTable

    db.SchemaVersion = db.SchemaVersion  + 1

    db.close       

End if

// now we have current structure of db

Mydb as MyDatabase = new MyDatabase
Mydb.Open



3) in your case you want drop current table, then create it back.
    then DO NOT use it as class!

You can have OTHER tables as classes:

    MyDatabase

        // STATIC tables.
        // Objects of static tables are created BEFORE Create()
        t1 = new MyTable1
        t2 = new MyTable2
        t3 = new MyTable3
    end

But MyTable4 must be DYNAMIC, and you  need create it AFTER db.Create() or
db.Open. And note, there is no FIXED pointer to tables.

----------------------------
App.Open
    dim db as MyDatabase = new MyDatabase
        // this have create 3 *objects* of VTable in memory

    db.Create() 
        // this have create them on disk


   // now you can in any place and in any time create 4th table
   tbl = db.CreateTable( "Table4" )

    db.DropTable( tbl )
end    


-- 
when you need get pointer to this table you do simply
    db.Table( "Table4" )
    

------
http://www.valentina-db.com/dokuwiki/doku.php?id=paradigma:public:en:documen
tation:articles:articles

Here read article  -- Choosing a Style of Coding



-- 
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