valentina and rev 2.0

Jan Schenkel janschenkel at yahoo.com
Wed Jun 18 13:30:00 EDT 2003


--- "jrvalent at wisc.edu" <jrvalent at wisc.edu> wrote:
>   Well, I have been working away trying to write a
> good dictionary program
> for an endangered language i work with. i have been
> trying to use the
> valentina xcmd and runrev 2.0, on both mac os x.2.6
> and mac os 9.2.2.  so
> far, my results are dismal, to say the least. here
> are some problems:
> 

Hi Rand,

I'm sorry to read your attempts have been
unsuccessful. Let's see if we can get you out of this
situation and back on track. I'll comment per
question.

> a. I open my Valentina database using RunRev's
> built-in database query
> builder; the database has several distinct tables,
> only one of which has a
> unique primary key, though the rest all have records
> that can be uniquely
> identified by field combinations. Now one thing that
> throws me is this: when
> i select the unique field in the table having such
> to be the primary key,
> and then close the database query builder (dbqb) --
> when i reopen the dbqb,
> it almost always lists "None" as the primary key,
> unless I click on the
> "refresh" button. Is this correct behavior? Same
> thing happens with
> multi-field key definitions in the dbqb: i type for
> example "fld 1,fld 2,
> fld 3, fld 4" into the dbqb, close it up, and when
> reopening, the primary
> key is listed as "None" until I click "refresh".
> What is going on here?
> 

When do you open the connection and when do you close
it ? (stack or card ?)
See if helps if you change these to "when stack
opens/closes" for each query.

>   Also, I do not understand why if there is only one
> database open, RunRev
> can give me a number such as "3", "5" or "7". Why
> not "1"? Are there some
> ghost databases open? This perplexes me.
> 

Nothing to worry about, this is just an internal
number that is increased when a new connection is
opened.
However, numbers aren't re-used when a connection is
closed, so if you close the connection when the card
closes, it drops that number.

> b. When I tried to intialize Valentina directly,
> without using the dbqb, all
> hell broke lose. I made a typo in the path to the
> database, and 1.
> Revolution instantly crashed; 2. opening my stack
> again, and querying
> revopendatabases() produced a negative number,
> something like -412 (followed
> by many more digits) [i fixed this by reinstalling
> _revolution_]. When I was
> certain that I had the correct path specified, and
> ran the stack in which I
> was trying to get Valentina initialized, the stack
> crashed, _and_ the dbqb
> no longer functioned-- it was hopelessly broken. On
> my g4 cube running in
> os9.2.2, I cannot now fix this -- even reinstalling
> RunRev has no effect. I
> have checked my Valentina databases using
> Valentina's built-in checker, and
> it says that there's nothing wrong with the
> database. Does this mean that my
> system has to be reinstalled to get things to work?
> How could this be?
> 

I'm surprised it crashed so heavily. Maybe you could
trace the script and post a bit more on where in your
code things go wrong?
If the first call is in your preopenstack, try locking
the messages before opening the stack ; that way you
can get in and add a breakpoint.

>   I really love RunRev, think it's a wonderful and
> powerful potential tool
> for people like me, academics who need some
> programming power in their
> research, but don't have time to learn C++ or some
> such thing. But I want to
> write a database stack that I can give to typical
> computer users -- when the
> program is so finicky, i really worry.
> 

While it is true not everything is completely
bullet-proof, for a system as intricate as RunRev,
things are very stabgle (thankfully) -- but as in
every program, the least-used corners of the program
are most likely to show erratic behaviour.

>   We so need our Danny Goodman to show up and write
> us a good cookbook, too.
> I think the docs on using the dbqb are quite good,
> but they really lack in
> not giving us a clear-cut example of usage -- e.g.,
> I still can't figure out
> how you _delete_ a record using runrev db commands,
> but i've probably
> overlooked something.
> 
> rand
> 

It's true that some parts of Revolution could use more
documentation, more examples, more tutorials, etc. But
the quality of the existing docs is fenomenal -- and
the current cookbook in the electronic docs is jnust
the start of a lot more.
Just give Jeanne some more time, and I'm sure she'll
bedazzle us all.

Yes, a good thorough book that would cover certain
aspects from top to bottom, would be a welcome
addition.
But that takes time to write, and the juiciest aspects
of RunRev are evolving at an impressive rate. The
topic has been raised numerous times, and IIRC someone
has an e-book upcoming.
The biggest effort will be in finding a publisher --
so if you have good connections with one, don't
hesitate to tell us and do some lobbying :-)

In the meantime, the User Contributions still contains
an example by our dear friend Tuviah, which can also
be hooked up to Valentina.
It shows many techniques that are still applicable,
even though Revolution 2.0 has added some synonyms.
Direct link :
http://www.runrev.com/revolution/downloads/developerdownloads/DB%20Examples.zip

As for deleting a record, try the following :
  -- first fetch the name of any query connected to
our database
  put "some_query" into tQueryName
  -- now create the SQL statement
  put "DELETE FROM customers WHERE customer_ID=999"
into tSQLQuery
  revExecuteWithQuery tQueryName, tSQLQuery
  -- end of code snippet

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com



More information about the use-livecode mailing list