>Hi All:
>
>I am running 2 instances of VFP to simulate a file sharing problem. When instance 1 says:
>
>
>USE foo EXCL
>
>
>This works in instance 2:
>
>
> TRY
> USE foo SHARED
> CATCH TO ww
> MESSAGEBOX('Problem! You got error # ' + ALLTRIM(STR(ww.errorno)))
> ENDTRY
>
>
>HOWEVER when instance 1 says:
>
>
>USE foo
>flock()
>
>
>the 2nd instance just hangs with the following message in the status bar:
>
>
>Attempting to lock... Press <esc> to cancel
>
>
>How can I handle that situation gracefully with TRY..CATCH? I need this since the other system seems to be doing something like flock() and there's no way I can get the user to change the program.
>
>Thanks,
>
>Yossi
You can use SET REPROCESS TO ... SECONDS to define how long you want to try to lock. And then check what value returned from flock() to see if it was successful or not. But the error won't be triggered.
HTH.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham