Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for Table in a directory
Message
From
16/07/2001 15:56:53
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Checking for Table in a directory
Miscellaneous
Thread ID:
00531200
Message ID:
00531200
Views:
43
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.
Next
Reply
Map
View

Click here to load this message in the networking platform