Subject: | Re: Help with LocateNextPattern
| Date: | Fri, 16 Aug 2019 08:42:22 -0400
| From: | Kevin Baker <shcsbaker@gmail.com>
| Newsgroups: | pnews.paradox-development
|
Mike,
First thanks for sticking with me on this.
I did change the for loop. It wasn't going back to the top and moving
down to look for the stFindValue. This code just moves the person from
ListA to ListB, so yes, once I find the person, I don't need to continue
down the list as the person would only be in the List once.
The while..endWhile and for..endFor have never been as clear to me as
they should and for some reason, it's always been difficult for me to
follow the logic. Thankfully folks like yourself have helped me along.
Here's the latest code:
uiListFrom.Attach(ListA1)
uiListTo.Attach(ListB1)
uptc.open("Main.DB")
uptc.edit()
delayScreenUpdates(Yes)
tc.open(":PRIV:__avcell.db")
tc.home()
gotHit = tc.locatePattern(WG,WGC)
while gotHit
stFindValue = tc."ListName"
vid = tc."Main ID"
scan uptc for uptc."Main ID" = vid :
uptc."Selected" = "Y"
uptc.postRecord()
endscan
for siCounter from 1 to (uiListSearch.list.count)
uiListSearch.list.selection = siCounter
if (stFindValue = uiListSearch.list.value) then
uiListTo.list.selection = uiListTo.list.count + 1
uiListTo.list.value = uiListFrom.list.value
uiListFrom.list.value = ""
quitloop
endif
endfor
gotHit = tc.locateNextPattern(WG,WGC)
endWhile
uptc.endEdit()
uptc.close()
tc.close()
|