open status

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Jan 18 00:36:31 CST 2008


On 17/1/08 3:45 PM, "-= JB =-" <sundown at pacifier.com> wrote:

Hi JB,

> In your recent replies you explained dbRef very good below
> and another answer asked me to explain my task.
> 
> The task is simple.  All I wanted to do was use the throwout
> command.  It said the database needed to be closed to use
> it so I started thinking it needed a file path instead of dbRef.
> Then I started looking for a way to make sure the database
> was closed so the user would not get an error.
> 
> After your explanation and my reading it better I realize the
> Throwout command uses a dbRef.  Therefore to use it I will
> need to open the database first and then close it before I
> can use Throwout with dbRef.

Right.

May be this points will help you better understand Valentina for Revolution
model. 

1) Valentina engine is written on C++.
    we love OO design.

2) many supported language (REALbasic, C#, ObjC) also are OO languages, so
we provide for this normal classes. If you know at least one OO language,
you know this syntax:

    db = new Vdatabase
    db.open()
    db.close()
    db.throwout()
    db = nil

I.e. You need CONSTRUCT and DESTRUCT object.
And you call its methods via DOT syntax.


3) Few languages, as Revolution, PHP, C are not OO,
    but we simulate this OO style.
    For this role of OBJECT play dbRef, tblRef, ...
    and first parameter of most methods is this Ref

> Maybe I need to keep track of databases that have already
> been opened to eliminate the confusion.  Is there a problem
> with opening a database that has already been opened?  If
> not then I could just open it, close it and throwout even if it
> was open already.

If you have dbRef on hands you need just code:


    if VDatabase_IsOpen( dbRef )
        VDatabse_Close( dbRef )

    // here we know that dbRef is closed.
    VDaatabse_ThrowOut( dbRef )


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