VFP9 SP1. I have an application that has been running on a client’s Windows 7 computer for a year with no problems. I am still using XP for development. Now when the app runs on the client's machine and tries to read a directory using ADIR() it doesn’t see all of the files. Supposedly, nothing has changed on the client’s computer. I build a cursor and insert the file names into the cursor from the array created with ADIR(). I use this cursor as the Row Source for a combo box and it does not have all of the file names from the folder. We're only talking about 30-40 files here and the gTemplateFilePath folder is on the local computer. The code below has worked well for the past year. Has anybody had any problems similar to this? I don't think it is an Admin/Other user issue with who created the files because there is only one user?
Auguy
Sylvania/Toledo Ohio
Code:
* Find Word template files
Local TemplateCount, FileArray, MaxFileLength, Counter1
TemplateCount = Adir(FileArray, gTemplateFilePath + '*.doc*', '', 1)
* files found
If TemplateCount > 0
* Maximum length of file name
MaxFileLength = 0
* Strip '.doc' from file name
For Counter1 = 1 To TemplateCount
FileArray(Counter1,1) = Strtran(FileArray(Counter1,1), '.docx')
FileArray(Counter1,1) = Strtran(FileArray(Counter1,1), '.DOCX')
FileArray(Counter1,1) = Strtran(FileArray(Counter1,1), '.doc')
FileArray(Counter1,1) = Strtran(FileArray(Counter1,1), '.DOC')
MaxFileLength = Max(MaxFileLength, Len(FileArray(Counter1,1)))
Endfor
* Sort array
Asort(FileArray)
* WordTemplates cursor
Create Cursor WordTemplates (FileName C(MaxFileLength))
For Counter1 = 1 To TemplateCount
Insert Into WordTemplates (FileName) Values (FileArray(Counter1,1))
Endfor
Endif
Auguy
Sylvania/Toledo Ohio