Subject |
locate works differently 2.8 and 9.5 |
From |
Antti Tanskanen <antti.tanskanen@elisanet.fi> |
Date |
Sat, 24 Jan 2015 05:48:55 -0500 |
Newsgroups |
dbase.getting-started |
Hi
I have dbase versions 2.8 8.x and 9.5. I have found that many things work differently in these version and maybe there are still some bugs in the calculations for running same data gives different results on different versions.
Now I discovered that locate don't work the same way: 2.8. works correctly and 9.5 seeks all the parameter length (len_) down to 1. The idea behind this code is to find a parameter from atcluo file where the vnrker is > 0 and the atc code is longest possible (most accurate).
Any idea why 9.5 (and 8.x) do not work like 2.8 (and as i want).
br. Antti
len_=7
found_=.f.
do while len_ >= 1
sele atcluo
locate for substr(vnro_len_->atc,1,len_)=substr(atcluo->atc,1,len_)
IF found()
if ((len_=7 .or. ( len_ < 7 .and. (substr(atcluo->atc,len_+1,1)=' ' .and. substr(atcluo->atc,len_,1)<>' '))) .and. (atcluo->vnrker > 0))
found_=.t.
exit
else
do while .not. eof()
continue
if ((len_=7 .or. ( len_ < 7 .and. (substr(atcluo->atc,len_+1,1)=' ' .and. substr(atcluo->atc,len_,1)<>' '))) .and. (atcluo->vnrker > 0))
found_=.t.
exit
endif
enddo
endif
endif
len_=len_-1
enddo
|
|