Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR, SYS(2000) and Filer all returned wrong results
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01173982
Message ID:
01174142
Views:
11
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') && Note: get the "first" file that matches.
>
>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) && get the "next" exe.
>
>ENDDO
>
>= MESSAGEBOX("Execution Time = " + STR((DATETIME() - m.ltTime))) && This always returns zero. Kewl! :^)
>= 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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform