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:
01174135
Views:
11
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
--
Randall Jouett
Amateur/Ham Radio: AB5NI
I eat spaghetti code out of a bit bucket while sitting at a hash table! Someone
asked me if I needed salt, and I said, "I'm not into encryption." :^)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform