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:
01173986
Views:
18
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.

What do you think should I do to fix the situation?

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...


>Hi everybody,
>
>I decided to start a new thread, which is a continuation of "Invalid subscript reference" thread.
>
>I re-coded my program a minute ago to use sys(2000) instead of ADIR. I have a directory with more than 13K jpg files and I'm trying to search for *e4*.jpg. ADIR, Filer and SYS(2000) all return 112 files where 9 of them do not have e4 as part of the name.
>
>Here are the wrong files returned:
>
>K-NK1648PS.JPG
>W-PT9144OX.JPG
>W-ER3953D.JPG
>W-ER3963D.JPG
>W-TB2302D.JPG
>W-TB2123D.JPG
>W-TB2332D.JPG
>W-TB1207D.JPG
>W-PT9216D.JPG
>
>and here is the test program
>
>	#define crlf CHR(13) + CHR(10)
>*!*	oMyFiler = CREATEOBJECT('Filer.FileUtil')
>*!*	oMyFiler.SearchPath = "t:\jpg"
>*!*	oMyFiler.FileExpression = '*e4*.jpg'
>*!*	oMyFiler.Find(0)
>*!*	=MESSAGEBOX(oMyFiler.Files.Count)
>*!*	_cliptext = ""
>*!*	FOR EACH loFile IN oMyFiler.Files
>*!*		_cliptext = _cliptext + loFile.Name + CRLF
>*!*	NEXT
>=MESSAGEBOX(DIRECTORY("t:\jpg"))
>ltTime = DATETIME()
>_cliptext = ""
>CREATE CURSOR crsTest (FieldName C(50))
>lcFileName = SYS(2000,[t:\jpg\*e4*.jpg]) && All files
>DO WHILE NOT EMPTY(lcFileName)
>*!*	   IF LIKE(UPPER(myStemPart), UPPER(JUSTSTEM(lcFileName))) OR;
>*!*	      LIKE(UPPER(myExtPart), UPPER(JUSTEXT(lcFileName)))
>*!*	
>*!*	   ENDIF
>	WAIT WINDOW NOWAIT m.lcFileName
>	IF NOT "E4" $ UPPER(m.lcFileName)
>		_cliptext = _cliptext + m.lcFileName + CRLF
>		INSERT INTO crsTest VALUES (m.lcFileName)
>	endif
>   lcFileName = SYS(2000,[t:\jpg\*e4*.jpg],1)
>ENDDO
>=MESSAGEBOX(DATETIME() - m.ltTime)
>=MESSAGEBOX(RECCOUNT('crsTest'))
>
>I'm accessing this computer through LogMeIn and the computer is connected to terminal server where the files reside. The connection with the server is not very good from our place.
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