Paradox Community

Items in pnews.paradox-development

Subject:Re: Help with LocateNextPattern
Date:Thu, 15 Aug 2019 23:11:37 +0100
From:Michael Kennedy <Info@KennedySoftware.ie>
Newsgroups:pnews.paradox-development
On 15/08/2019 22:14, Kevin Baker wrote:
> Ok, I'm still not sure I follow your recommendation.  Would the first 
> locate be in a if then statement?  And then once I issue the locate 
> next, I'd be using the same code from the if then above in the locate 
> next statement?

No need for an "If", Kevin (I think). (I'm not familiar with the Opal 
syntax, but maybe something like this):

... Prep steps...
uptc.open("Main.DB")
uptc.edit()

delayScreenUpdates(Yes)

tc.open(":PRIV:__avcell.db")         ;This is database A
tc.home()
Got_Match = tc.locatePattern(WG,WGC) ;WG=Field Name, WGC=value reqd
While Got_Match
    ... If needed, SAVE (note) which record you're on (in TC table)
    ... Do things! - as per your existing code...
    ... I see you're running a SCAN on UPTC... Does that move focus
    ... away from your TC table... If it does, then you probably
    ... need the Save/Restore steps...
    ... If needed, Move back to the TC table, and to the same record
    Got_Match = tc.locateNextPattern(WG,WGC)
endWhile
uptc.endEdit()
uptc.close()
tc.close()


Copyright © 2004 thedbcommunity.com