Re: USED()
- From: "TonySper" <tsperduti@xxxxxxxxxxxxxxxxxxx>
- Date: Sat, 10 May 2008 12:51:41 -0400
Olaf
I thought so but ran into a problem checking it and apon looking into the
help, this is what I found.
Parameters
nWorkArea | cTableAlias
Specifies a table's work area or alias. USED( ) returns a logical true
(.T.) if a table is opened in the work area you specify with nWorkArea;
otherwise a logical false (.F.) is returned. USED( ) returns a logical true
(.T.) if an alias is in use with the alias you specify with cTableAlias;
otherwise false (.F.) is returned.
If you omit nWorkArea and cTableAlias, USED( ) returns a logical true
(.T.) if a table is open in the currently selected work; otherwise false
(.F.) is returned.
Remarks
USED( ) can determine if an alias is in use or if a table is open in a
specific work area.
I was useing the following and and got an error saying that file was already
open at times. I ended up using
use in lastid to close the file after I could not repeatly calculate if the
file was open or not as I did not know in which area it was being used.
IF USED('lastid.dbf')
SELECT LASTID
ELSE
SELECT 0
USE LASTID
ENDIF
What am I doing wrong in the above that I could not detect that the file was
open at times??
Tony
"Olaf Doschke" <olaf.doschke@xxxxxxxxxxxxxxxx> wrote in message
news:A339EAAC-5ABE-4B1C-A1C2-8527EB50CEDB@xxxxxxxxxxxxxxxx
Hi Tony,
USED( ) can determine if an alias is in use or if a table is open in awrong
specific work area.
USED(nWorkarea) determines if a workarea is in use,
but you will mostly use it as USED(cAlias), which checks,
if a certain alias is in use in _any_ workarea of the current
datasession. So there you have your answer.
Bye, Olaf.
.
- Follow-Ups:
- Re: USED()
- From: Olaf Doschke
- Re: USED()
- References:
- USED()
- From: TonySper
- Re: USED()
- From: Olaf Doschke
- USED()
- Prev by Date: Re: Feature is not available?
- Next by Date: Re: How to debug/track a record pointer change event?
- Previous by thread: Re: USED()
- Next by thread: Re: USED()
- Index(es):
Relevant Pages
|