You are correct Sir! I stand corrected on all counts.

The if/else and "eval db" is what happens when you just type something
and don't actually run it... Could definitely be confusing to a
beginner.

I'll try to be more diligent in the future.

Thanks,

Jeff.

-----Original Message-----
From: Kurt Welgehausen [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 05, 2005 5:40 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] how to get notice when database is free after it
was busy


> So, you can use something like this:
>
> if { ! [catch {set selectResult [eval db "select x from y where z = 
> 'blah'"]} catchErr] } {
>   puts "Failed - the error is $catchErr"
> } else {
>   puts "selectResult= $selectResult"
> }
>

Except that you've got the if/else clauses reversed
(or just remove the !) -- also, you don't really need
the 'set selectResult', although it's sometimes
convenient, because if the script succeeds, the result
will be in the supplied variable (catchErr in this
case) -- also, it's 'db eval', not 'eval db'.

Regards


Ridgeview Medical Center Confidentiality Notice: This email message, including 
any attachments, is for the sole use of the intended recipient(s) and may 
contain confidential and privileged information. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply email and destroy all copies of 
the original message.

Reply via email to