From: jim.giner@suny.edu   
      
   Yes - you have it now. The scan will allow you to "see" all the records in   
   tc2. When you see one you like, you "locate" in the other table. If it's   
   not there, you "do stuff", otherwise I assume you just move on.   
   "Kenneth" wrote in message   
   news:p066a4hqq3dsigp1foj1es4io64tr74kkv@4ax.com...   
   > On Wed, 13 Aug 2008 13:12:21 -0400, Jim Hargan   
   > wrote:   
   >   
   >>In this line:   
   >> if (tc2.locate ("num", ident, "desc", "W") ...   
   >>the locate() moves your tCursor within the scan. The next time the scan   
   >>loops, it will take over from this new position. And this new position is   
   >>always the same position, as locate() always sends the tCursor to the   
   >>first   
   >>matching record. So your scan gets stuck on one record.   
   >>   
   >>Never move either the scanning tCursor or any records within a scan loop.   
   >>   
   >>The scan should be sending tc2 straight to the correct records, as with:   
   >> scan tc2 for tc2."num" = ident and tc2."desc" = "W":   
   >> ;do something   
   >> endscan   
   >>or else testing withing the scan, as with:   
   >> scan tc2:   
   >> if tc2."num" = ident and tc2."desc" = "W"   
   >> then ;do something   
   >> else loop   
   >> endif   
   >> endscan   
   >   
   > Hi Jim,   
   >   
   > Many thanks for the speedy and very helpful response...   
   >   
   > But I am still not sure I correctly understanding how I   
   > should set things up to do stuff only if something is found   
   > in the first table, but not in the second.   
   >   
   > Should that look something like this:   
   >   
   > scan tc2:   
   > If tc2."num" = ident and tc2."desc" = "W" and   
   > not tc1.locate("num",ident,"desc",W1)   
   > then   
   >   
   > do something   
   >   
   > All the best,   
   > --   
   > Kenneth   
   >   
   > If you email... Please remove the "SPAMLESS."   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|