skipped items in directory

Richard Kreiss rkreiss at verizon.net
Sat Sep 3 09:18:01 PDT 2011


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 need to see if any record was created twice.

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?

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")

Additional processing to post to a filepro file

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



More information about the Filepro-list mailing list