Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error with Adir()

Status
Not open for further replies.

sqlpro

Programmer
Dec 30, 2003
297
NZ
Hi friends

i am getting an error with following command
Code:
lntot=ADIR(x,'\\ben\C\Vip_versions\tstnzgp\doc\*.*')
error is
Invalid subscript reference

actually abv folder contains around 14000 files.
is there any workaround for this?
Thanks


cheers
 
have you tried the maped frive letter to this UNC?

Attitude is Everything
 
Hi danceman
Thanks for the post.
No i did not try mapped drive.

actually i'm think the problem is with no of files.
if the folder contains only 10000 files then abv command
works perfectly if it exceeds 12000 then i get abv error.
i am wondering how to get around that

cheers
 
try not using the *.* to restrict the number of files. creat two arrarys and then combine them afterwards.

Attitude is Everything
 
actually i thought of that.
what if i dont know the extension of files that exist in
the folder?
how can i specify that i want only first 10,000 files then
next 10,000 like that...
Thanks for ideas :)

cheers
 
It may not be a foxpro problem. I do not remember the numbers, but depending on the version of windows you are running there are limits on the number of files that can exist in a folder safely. this could be why you can not get your results. try searching microsoft knowledge base.

Attitude is Everything
 
sqlpro,

Have you tried using?

SYS(2000,'*.*')

SYS(2000,'*.*',1)

Put the second line in a loop and loop 10,000 times or until the function returns an empty string.

boyd.gif

craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
No Craig
i finally endedup taking files into a text file(using List())and creating a cursor from that text file.

cheers
 
ADIR() creates an array, which is limited (until VFP 9) to 65,000 elements. Each file has 5 elements, so the ADIR() will fail at around 13,000 files.

To get around this, use Windows Scripting faq184-4136

Brian
 
Thanks Brian
That is very useful link :)

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top