Hi Randall,
I don't see any mask used in your example. Try
SYS(2000,'c:\windows\*w*.exe') in both SYS commands.
BTW, one unrelevant comment - you don't have to use m. as m.lcFileName when lcFileName is on the left side. Only when it's on the right.
>Howdy Naomi,
>
>>I modified the test program slightly to get lcMask by Inputbox and for E3 I have 11 wrong files:
>>
>>W-ER4026D.JPG
>>W-ER4036D.JPG
>>W-ER4056D.JPG
>>W-ER4066D.JPG
>>W-TB2211D.JPG
>>W-TB1022D.JPG
>>W-NK646CIT.JPG
>>W-TB2209D.JPG
>>W-TB2408D.JPG
>>W-TB2289A.JPG
>>W-TB2448D.JPG
>>
>>I think I can stop testing for now.
>
>
>I tried the following code (slightly modified) with no problems with VFP 9 SP1:
>
>
>
>#define crlf CHR(13) + CHR(10)
>
>= MESSAGEBOX(DIRECTORY("c:\windows"))
>
>m.ltTime = DATETIME()
>
>_cliptext = ""
>
>CREATE CURSOR crsTest (FieldName C(50))
>
>m.lcFileName = SYS(2000,'c:\windows\*.exe')
>
>DO WHILE NOT EMPTY(m.lcFileName)
>
> WAIT WINDOW NOWAIT m.lcFileName
>
> UPPER(m.lcFileName)
> _cliptext = _cliptext + m.lcFileName + CRLF
> INSERT INTO crsTest VALUES (m.lcFileName)
>
>*!* NOTE! Notice the 1 here..for get the "next" record that matches.
>
> m.lcFileName = SYS(2000,'c:\windows\*.exe', 1)
>
>ENDDO
>
>= MESSAGEBOX("Execution Time = " + STR((DATETIME() - m.ltTime)))
>= MESSAGEBOX("Record Count = " + STR(RECCOUNT('crsTest')))
>
>
>
>>What do you think should I do to fix the situation?
>
>Try running the above code and tell me if it works, please.
>
>>One of the ideas is to create a list of all jpg and tif files in the directory at night
>>and use this list from the application. We need to have a directory monitor for this approach
>>since new files may be added during the day... It's achievable in VFP9 and documented in solution/samples...
>
>I guess you could do a cron-type thing, getting all of the new files for today or
>something. (Shrug.)
>
>Regards,
>
>Randall
If it's not broken, fix it until it is.
My Blog