Paradox Community

Items in pnews.paradox-programming

Subject:Re: Tcursor
Date:Thu, 28 Mar 2019 15:49:34 -0500
From:Mark Bannister <markRemove@THISinjection-moldings.com>
Newsgroups:pnews.paradox-programming
Yes there could be full table locks on the table that would cause it to 
fail.

On 3/28/2019 4:16 PM, Peter wrote:
> Once a tcursor is opened is there is any way tc.edit() can fail?
> 
> I used to always do this
> if tcu.open(":alias:Atable") then
>     if not tc.edit() then
>        tc.close()
>     endIf
> endIf
> 
> The problem with if/endif is that if open fails then Pdox err comes up 
> and I would rather it didn't so I switched to try/endTry
> try
>     tc.open(":alias:Atable")
>     tc.edit()
> onFail
>       msgInfo("error","error msg")
>       if tc.isAssigned() then
>          tc.close()
>       endIf
> endTry
> 
> Using try/endTry, will trap a problem with opening but not edit, even if 
> I put a write lock (from a different machine) on the table the onFail 
> does not trigger. So I am wondering if it is possible that edit could 
> ever fail.
> 
> Thank you.
> 
> Peter
> 
> 


Copyright © 2004 thedbcommunity.com