Funny how the obvious is not obvious until you see it! Thanks, Albert! Dennis McGrath
From: [email protected] [mailto:[email protected]] On Behalf Of Michael J. Sinclair Sent: Wednesday, August 06, 2014 11:06 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: Counting files in a directory What a great idea! I have been looking for the same thing. Thanks for posting this. Mike ________________________________ From: Albert Berry <[email protected]<mailto:[email protected]>> To: RBASE-L Mailing List <[email protected]<mailto:[email protected]>> Sent: Wednesday, August 6, 2014 11:45 AM Subject: [RBASE-L] - Re: Counting files in a directory Try this Karen - I needed to do this for another app, and came up with this. If the file does not exist, it returns error 2255; if the file exists verrsave is 0. SET ERR MESS OFF SET VAR vFile2find text = "*.rx5" SET VAR vErrSave INTEGER SET ERROR VAR vErrVar DIR .vFile2Find SET VAR vErrSave1 = .vErrVar SET VAR vFile2find text = "*.rx1" DIR .vFile2Find SET VAR vErrSave2 = .vErrVar SHOW VAR vErrSave% RETURN Albert On 8/6/2014 8:55 AM, Karen Tellef wrote: Using 9.5, 64-bit, and have the Power Plugin pack available to me. Back in 7.6, ChkFile worked with wildcards even though the documentation said the results would be inconsistent. For example, if you wanted to see if there are any excel files in a directory, you could: set var vcount = (chkfile('c:\temp\*.xls')) It would return 1 if there were files, 0 if there wasn't. So now I'm in 9.5 and I want to check if there are files in a directory. The ChkFile doesn't work for this, and I looked thru the plugin document and don't see a filecount. Is there a nice elegant way to do this now, or do I have to do directories to a file to a temp table, etc... Karen

