Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One cursor available but the other not
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
01140317
Message ID:
01140348
Vues:
20
>>>Hi BB
>>>
>>>That didn't work either. Besides, how would FILE() work if its arguments aren't on the VFP path?
>>>
>>>Thanks
>>>
>>>Terry
>>
>>
>>It works great if you send full path to it.
>
>That's the point. I don't know the path.
>
>>I prefer to use EMPTY(SYS(2000, [.....])) instead of FILE() becuase it return correct values event the file with the same name exists in current path.
>>BTW what do you mean with "it didn't work"?
>>FILE() return .f.?
>
>Well, like you and I say, FILE() works if you send it the whole path, but I can't guarantee where the cursor will end up, and it's not on the VFP path. I don't understand about sys(2000). How will it ever find the file in the vastnaess of the network and local drive, uif no path is provided?

When I search for file I always know where to search it. BTW DBF() always returns full path to dbf. FILE() is dangerous (my oppinion) becuase imagine this situation:
1. You have file named Test.DBF in c:\Test folder
2. Your PATH is SET PATH TO c:\Test

and you check:
IF FILE([C:\SomeOtherFolder\Test.DBF])
   *** THAT PART OF CODE WILL ALWAYS EXECUTE
   *** NO MATTER IF YOU HAVE FILE NAMED TEST.DBF in C:\SomeOtherFolder
ENDIF
I just think, why you test for existance of that cursor. The cursor will be always created if you use SELECT. Not metter if there is some records in it or not:
SELECT * from SomeTable WHERE .f. INTO CURSOR crsTest NOFILTER READWRITE
? _TALLY && -> 0
? DBF([crsTest]) && Something like c:\documents and settings\your user name\Local Settings\Temp\_q123asd.tmp
? FILE(DBF([crsTest])) && .T.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform