Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.paradox    |    To crash or not to crash, asks Borland    |    9,834 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 9,400 of 9,834    |
|    Jim Hargan to Kenneth    |
|    Re: My scan isn't scannin'...?    |
|    13 Aug 08 14:22:43    |
   
   From: contact@harganonline.com   
      
   Let's see if I get this right. You want to check each record in tc2's table   
   that has a "desc" of "W", and see if there is a record in tc1's table with   
   the same "num" and a "desc" of "W1". If, and only if, you find the tc1   
   record, you do something. Right? Then you are on the right track.   
      
   Perhaps,   
    scan tc2 for tc2."desc" = "W": ;possibly faster   
    if tc1.locate("num",tc2."num","desc","W1") then   
    ;do something   
    endif   
    endscan   
      
   If tc1's table is indexed on "num" and "desc", and the index is named (say)   
   "byNumAndDesc", this would execute much faster:   
    tc1.switchIndex("byNumAndDesc")   
    scan tc2 for tc2."desc" = "W":   
    if tc1.qlocate(tc2."num","W1") then ;uses the index   
    ;do something   
    endif   
    endscan   
      
   --   
   Jim Hargan   
      
   On Wed, 13 Aug 2008 13:28:10 -0400, Kenneth wrote:   
   > 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,   
      
   > On Wed, 13 Aug 2008 13:12:21 -0400, Jim Hargan   
   >
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca