skipped items in directory

Craig Tooker craig at cwtsoftware.com
Sat Sep 3 21:47:00 PDT 2011


On 9/3/2011 12:18, Richard Kreiss wrote:
> I have to read in and compare a list of filenames which were created by filepro.  The filename is in the form  record number_datetime.xml.
I'm not aware that filePro creates .xml files but that's a quibble. 
Might we know the platform and filePro version number under which this 
code operates. Additionally, have you checked the filePro manual on the 
fp web site, looking in the various readme files for your version and 
those that come later for a mention of this error being fixed? You would 
then know if you need an upgrade or actually need help.
>
> I need to see if any record was created twice.
What, when, where, how?
>
> I wrote the following program to read each file, get the record number and post to a new filepro file.  My problem is that it appears that the program is only reading half of the files.  It is skipping every other file.
>
> Based on the programming below, can anyone tell me why it is skipping records?
Please see above. I am aware of a known filePro issue revolving around 
opendir() / nextdir(). We can not, of course, know if that is the 
problem with knowing your version numbers. We can't suggest a work 
around without knowing your OS environment. But you know that.
>
> Richard Kreiss
>
> 16  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:
>         Then: chdir new_dir
>   17  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:
>         Then: qq=opendir("*.xml",new_dir)
>   18  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If: ct = "1"
>         Then: video sync;SHOWCTR ("3")"Records to Read \b2"<qq<"\a-"
>   19  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> loop_fi◄ If:
>         Then: qa=nextdir()
>   20  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:
>         Then: rr=rr+"1"
>   21  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If: qa = "" and rr = qq
>         Then: END
> 22  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If: qa = "" and rr lt qq
>         Then: ct=ct+"1";GOTO loop_fi
>   23  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:
>         Then: lc=strtok(qa,"_","1");recnum=""
>   24  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If: 'just the record number
>         Then: RecNum=mid(qa,"1",lc-"1")
>   25  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If: 'get the date
>         Then: rdate=mid(qa,"60","10")
>   26  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:
>         Then: rtime=mid(qa,"71","8")
Could you describe how QQ, CT, QA, RR, LC, recnum, rdate and rtime are 
defined? Not that it has anything to do with the problem but just 
wondering if you think "what is ..." is a question that could be 
answered without referring to a universal constant.
>
> Additional processing to post to a filepro file
Exactly how does the code below post anything to anything (unless you 
mean the screen)?
>
> next   ◄ If:
>         Then:         ct=ct+"1"
>   44  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If: ct lt qq
>         Then: video sync;SHOW("4","15") "Records Read"<rr;GOTO loop_fi
>   45  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:
>         Then: END
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list


More information about the Filepro-list mailing list