Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for Table in a directory
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00531200
Message ID:
00531202
Vues:
13
>I am trying to check for a table in a directory. I am using a xls sheet to create a fox pro table. What I am trying to do and what I have already done is as follows:
>I have ftp a xls file into a folder in a directory.
>Hey everyone,
>Here is a scenario of my problem. If anyone has any thoughts, please let me know.
>
>scenario:
>
>I search the directory for an xls file for one that is present in the directory using the sys(2000, directory\*.xls).
>I substring the *.xls file into several variables and use these variables to name a table I have already built.
>Ex: variable = substring(*.xls, 1, 2)
>I do this by copying the structure of a table I have already built and naming it using the variables I have substringed and append the xls sheet into it.
>Ex: use established table
>Copy Structure to ("directory\" +variable + variable + ".dbf")
>Use ("directory\" +variable + variable + ".dbf")
>append from (*.xls) type xls
>
>All this works fine. What I cannot figure out is how to check the directory to see if ("directory\" +variable + variable + ".dbf") is built. I do not want to rebuild the table if the table is already out there.
>
>I have tried to seek("directory\" +variable + variable + ".dbf")
>If found()
>append to it
>else
>the copy structure stuff.
>
>This does not work.
>
>Any suggestions would be appreciated. Thanks.

Have you looked at the FILE command?

mn = 'c:\temp\483.xls'
? FILE(mn)
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform