Solved

LIST OF DIRECTORY FILES APPEND TO A TABLE

Posted on 2011-03-22
2
706 Views
Last Modified: 2012-05-11
Hi Experts
I have a  direcotory called  gdata

I woild like to append the  list of all files in gdata including extension names and size to a table called gtable.
Please help
Thnaks
0
Comment
Question by:b001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Expert Comment

by:jrbbldr
ID: 35192935
You can use the VFP Function   ADIR()  to get a list of files in a specified directory.

The results will go into the specified array (look in your VFP Help file for details).

You can then LOOP through the array with a FOR/ENDFOR to pick up the names and put them wherever you need.

Good Luck


0
 
LVL 27

Accepted Solution

by:
CaptainCyril earned 500 total points
ID: 35193397
CREATE CURSOR files (filename C(100), size N(12))
nCount = ADIR(aFiles,'gdata\*.*')
FOR i = 1 TO nCount
      INSERT INTO files (filename, size) VALUES (aFiles(i,1), aFiles(i,2))
ENDFOR
BROWSE
0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Gain an elementary understanding of Blockchain technology.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question