Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem in Using USED()
Message
De
15/10/2001 18:13:21
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
15/10/2001 16:50:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00568793
Message ID:
00568827
Vues:
23
>Hi,
> I am facing below problem in Visual Foxpro. Here is the problem & little code.
>
> SELECT 0
> USE Employee ALIAS Empl && ( This file is opened in someother Function)
> * When control comes back, I am trying to open once again.
> SELECT 0
> USE Employee
>
> IT SAYS 'FILE IS IN USE'. So now how do I know that file is already opened. Now suppose I will make use of USED() function.
>
> IF USED('EMPLOYEE') - IT SAYS NO. Because it checks with ALIAS not table name.
>
> Ofcourse I have solution for this using AUSED() function. Get an array and find out each Alias's table name using DBF().
>
>BUT MY QUESTION IS, IS THERE ANY FUNCTION WHICH CHECKS WITH TABLE NAME INSTEAD OF ALIAS ?

No, all the functions which affect workareas use alias and/or area number. There's a workaround:
Function dbfused
Lpara cFilename
* make it the same format as the dbf() will return:
cFilename=Upper(Fullpath(DEFAULTEXT(cFilename,'dbf')))
Local i, lUsed
lUsed=.F.
For i=1 To Aused(aAliases)
	cFileUsed=Dbf(aAliases[i])
	If cFileUsed=cFilename
		lUsed=.T.
		Exit
	Endif
Endfor
Return lUsed

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform