Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Included or not
Message
De
14/07/2003 06:06:26
 
 
À
14/07/2003 05:41:20
Lutz Scheffler (En ligne)
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00809748
Message ID:
00809759
Vues:
30
hi Agnes,

I tried this on a customer's computer (not IDE) before posting.

I have a table \Project\Moses\Internal\Moses.dbf which is included

In runtime (and not on the computer I develop on), File('.\Internal\Moses.dbf') is TRUE, whereas FileExists('.\Internal\Moses.dbf') is FALSE

I have to add that vfp first tries to find the file on disk, and failing that, it looks in the included list of files. So if you try this in an exe make sure the file is not on the disk (rename it temporarily) in order to get the good results


>Hi Gregory,
>
>I failed with that.
>
>As far as I see you try to check if GetFileAttribute() returns a failure code.
>
>You may achieve this result using build in ADIR
>
>*--------------------------------------------------------------------------
>Function	FileExists(FileName)
>
>	return !EMPTY(ADIR(laDir,FileName))
>endfunc
>*--------------------------------------------------------------------------
>
>
>I open the table from my exe and run your or my function with DBF() as parameter. It returns .T. (DBF() points to the position where the file is stored on my comp). It is definetly not the on the comp opend because this is ReadWrite and ISREADONLY(DBF()) returns .T.. The DBF() of the table included in the exe is the full path to the location where its compiled from.
>
>If I try with just TheTableName.dbf it returns .F. what it should do because the table is not on the place where the exe is stored and not to find using PATH.
>
>ISREADONLY() on the other hand will will not be of any use in this because the file on the comp may be readonly. (It's normale state in SourceSafe for me)
>
>Agnes
>
>
>>Guillaume,
>>
>>File() will return TRUE for both built-in/external tables/files
>>
>>FileExists() will return TRUE only for external tables/files (RunTime, this is)
>>
>>
>>*--------------------------------------------------------------------------
>>Function	FileExists(FileName)
>>        declare Integer GetFileAttributes in win32api string @
>>
>>	return (GetFileAttributes(@FileName) <> -1)
>>endfunc
>>*--------------------------------------------------------------------------
>>
>>>Hi,
>>>
>>>Is there a way to determine if a certain table is included in the project or not? Before it is opened, I need to determine if it's a build-in or external table .
>>>
>>>Thanks again
>>>
>>>Guillaume
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform