Alaska Software Inc. - dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
Username: Password:
AuthorTopic: dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
Osvaldo Luis AokidbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
on Tue, 16 Jun 2009 14:56:28 -0300
Hi,
    
    In this new version I have been getting a error on dbSEEK() when
second parameter (lSoftSeek = .T..

    In all cases, after dbseek() if I test Found(), it returns .F....
    Any people experiment this error.. ?

    Thanks,
    Osvaldo L Aoki
Jorge LRe: dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
on Mon, 15 Jun 2009 22:48:39 -0300
Hi Osvaldo

when i perform a "dbseek( ...., .t. )"  i test for the key, i never test the 
result   ( por constumbre.... )




"Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> escribió en el mensaje de 
noticias news:6ce6f0d3$29423377$25aa@news.alaska-software.com...
> Hi,
>    In this new version I have been getting a error on dbSEEK() when
> second parameter (lSoftSeek = .T..
>
>    In all cases, after dbseek() if I test Found(), it returns .F....
>    Any people experiment this error.. ?
>
>    Thanks,
>    Osvaldo L Aoki
>
Osvaldo Luis AokiRe: dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
on Tue, 16 Jun 2009 23:20:15 -0300
Hi Jorge,

    yah, In the major of situations I test key too...
    but I think if I test FOUND() it must work if a eof() is not found 
yet... Dont you think ?

    I Alaska 1.9.330 it works well, but in 1.9.355 it stop to work....

    Osvaldo.


"Jorge L" <jlborlando@way.com.ar> escreveu na mensagem 
news:4dd9e333$618a7f5e$3fc9@news.alaska-software.com...
> Hi Osvaldo
>
> when i perform a "dbseek( ...., .t. )"  i test for the key, i never test 
> the result   ( por constumbre.... )
>
>
>
>
> "Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> escribió en el mensaje de 
> noticias news:6ce6f0d3$29423377$25aa@news.alaska-software.com...
>> Hi,
>>    In this new version I have been getting a error on dbSEEK() when
>> second parameter (lSoftSeek = .T..
>>
>>    In all cases, after dbseek() if I test Found(), it returns .F....
>>    Any people experiment this error.. ?
>>
>>    Thanks,
>>    Osvaldo L Aoki
>>
>
>
Jorge LRe: dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
on Tue, 16 Jun 2009 15:35:45 -0300
Hi Osvaldo

I believe that the function Found () must return .t., only it IndexKey() = 
cKey

but....i am thinking about remembering that in clipper works equally

Regards




"Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> escribió en el mensaje de 
noticias news:5b2e684e$31742193$3fdc@news.alaska-software.com...
> Hi Jorge,
>
>    yah, In the major of situations I test key too...
>    but I think if I test FOUND() it must work if a eof() is not found 
> yet... Dont you think ?
>
>    I Alaska 1.9.330 it works well, but in 1.9.355 it stop to work....
>
>    Osvaldo.
>
>
> "Jorge L" <jlborlando@way.com.ar> escreveu na mensagem 
> news:4dd9e333$618a7f5e$3fc9@news.alaska-software.com...
>> Hi Osvaldo
>>
>> when i perform a "dbseek( ...., .t. )"  i test for the key, i never test 
>> the result   ( por constumbre.... )
>>
>>
>>
>>
>> "Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> escribió en el mensaje de 
>> noticias news:6ce6f0d3$29423377$25aa@news.alaska-software.com...
>>> Hi,
>>>    In this new version I have been getting a error on dbSEEK() when
>>> second parameter (lSoftSeek = .T..
>>>
>>>    In all cases, after dbseek() if I test Found(), it returns .F....
>>>    Any people experiment this error.. ?
>>>
>>>    Thanks,
>>>    Osvaldo L Aoki
>>>
>>
>>
>
Osvaldo Luis AokiRe: dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
on Wed, 17 Jun 2009 16:17:25 -0300
Hi Jorge,

    I think it depends on point of view

    If you set softseek ON, I think it can find any other
register equal or next from defined seek key... Dont you think ?

   Osvaldo L Aoki

"Jorge L" <jlborlando@way.com.ar> escreveu na mensagem 
news:2f72da2f$53ad1b3f$40ce@news.alaska-software.com...
> Hi Osvaldo
>
> I believe that the function Found () must return .t., only it IndexKey() = 
> cKey
>
> but....i am thinking about remembering that in clipper works equally
>
> Regards
>
>
>
>
> "Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> escribió en el mensaje de 
> noticias news:5b2e684e$31742193$3fdc@news.alaska-software.com...
>> Hi Jorge,
>>
>>    yah, In the major of situations I test key too...
>>    but I think if I test FOUND() it must work if a eof() is not found 
>> yet... Dont you think ?
>>
>>    I Alaska 1.9.330 it works well, but in 1.9.355 it stop to work....
>>
>>    Osvaldo.
>>
>>
>> "Jorge L" <jlborlando@way.com.ar> escreveu na mensagem 
>> news:4dd9e333$618a7f5e$3fc9@news.alaska-software.com...
>>> Hi Osvaldo
>>>
>>> when i perform a "dbseek( ...., .t. )"  i test for the key, i never test 
>>> the result   ( por constumbre.... )
>>>
>>>
>>>
>>>
>>> "Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> escribió en el mensaje de 
>>> noticias news:6ce6f0d3$29423377$25aa@news.alaska-software.com...
>>>> Hi,
>>>>    In this new version I have been getting a error on dbSEEK() when
>>>> second parameter (lSoftSeek = .T..
>>>>
>>>>    In all cases, after dbseek() if I test Found(), it returns .F....
>>>>    Any people experiment this error.. ?
>>>>
>>>>    Thanks,
>>>>    Osvaldo L Aoki
>>>>
>>>
>>>
>>
>
>
Jorge LRe: dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
on Tue, 16 Jun 2009 18:52:51 -0300
Hi Osvaldo,

Particularly i use the softseek to look for the following element of the key 
by what there was not given I to ask for the found () ...

ie
F1 :=DToS( F1 )
A->( dbSeek( F1, .t. ) )
While ( A->FECHA <= F2 .....
........................

here, i don´t need evaluate found(), my while evaluate it,

but...,

Regards


"Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> escribió en el mensaje de 
noticias news:ae7a4ce$5016e383$476b@news.alaska-software.com...
> Hi Jorge,
>
>    I think it depends on point of view
>
>    If you set softseek ON, I think it can find any other
> register equal or next from defined seek key... Dont you think ?
>
>   Osvaldo L Aoki
>
> "Jorge L" <jlborlando@way.com.ar> escreveu na mensagem 
> news:2f72da2f$53ad1b3f$40ce@news.alaska-software.com...
>> Hi Osvaldo
>>
>> I believe that the function Found () must return .t., only it IndexKey() 
>> = cKey
>>
>> but....i am thinking about remembering that in clipper works equally
>>
>> Regards
>>
>>
>>
>>
>> "Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> escribió en el mensaje de 
>> noticias news:5b2e684e$31742193$3fdc@news.alaska-software.com...
>>> Hi Jorge,
>>>
>>>    yah, In the major of situations I test key too...
>>>    but I think if I test FOUND() it must work if a eof() is not found 
>>> yet... Dont you think ?
>>>
>>>    I Alaska 1.9.330 it works well, but in 1.9.355 it stop to work....
>>>
>>>    Osvaldo.
>>>
>>>
>>> "Jorge L" <jlborlando@way.com.ar> escreveu na mensagem 
>>> news:4dd9e333$618a7f5e$3fc9@news.alaska-software.com...
>>>> Hi Osvaldo
>>>>
>>>> when i perform a "dbseek( ...., .t. )"  i test for the key, i never 
>>>> test the result   ( por constumbre.... )
>>>>
>>>>
>>>>
>>>>
>>>> "Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> escribió en el mensaje de 
>>>> noticias news:6ce6f0d3$29423377$25aa@news.alaska-software.com...
>>>>> Hi,
>>>>>    In this new version I have been getting a error on dbSEEK() when
>>>>> second parameter (lSoftSeek = .T..
>>>>>
>>>>>    In all cases, after dbseek() if I test Found(), it returns .F....
>>>>>    Any people experiment this error.. ?
>>>>>
>>>>>    Thanks,
>>>>>    Osvaldo L Aoki
>>>>>
>>>>
>>>>
>>>
>>
>>
>
>
AUGE_OHRRe: dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
on Wed, 17 Jun 2009 05:28:05 +0200
hi,

> In this new version I have been getting a error on dbSEEK() when
> second parameter (lSoftSeek = .T..
>
>In all cases, after dbseek() if I test Found(), it returns .F....
>Any people experiment this error.. ?

can you show us some Code ?
NTX or CDX ? SET COLLATION ?

i think did have that Problem with "older" Xbase++ Version so
i still use old Cl*pper Code :
*** Code ***
FUNCTION DBSEEKLAST( cString )
LOCAL cIndexKey, cIndexVal, nLen

   cIndexKey := INDEXKEY( 0 )
   IF EMPTY( cIndexKey )                                  no active Index
      RETURN .F.                                                 *** 
RETURN  ***
   ENDIF

   nLen := LEN( cString )                                    add Chr() +1
   DBSEEK( LEFT( cString, nLen - 1 ) + ;        to work with SOFTSEEK
           CHR( ASC( RIGHT( cString, 1 ) ) + 1 ), ;
           .T. ) 
 SOFTSEEK ON

   DBSKIP( - 1 )                                               skip 
back -1
    compare String with Indexkey
   IF ( cString == LEFT( &( cIndexKey ), nLen ) )  use Exact "=="
      RETURN .T.                                             found!
   ENDIF

   DBSKIP( 1 )                                               if Eof() == 
.T.

RETURN .F.
*** Eof ***

greetings by OHR
Jimmy
Jack DuijfRe: dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
on Fri, 19 Jun 2009 22:52:16 +0200
Hello All.

As of the Alaska docs DbSeek():
<snip>
The return value of DbSeek() is .T. (true) when the specified value was 
found in the active index file. Otherwise it is .F. (false).

If the value of <IndexKeyValue> is not found in the index file, the position 
of the record pointer depends on <lSoftSeek> or on the SET SOFTSEEK setting. 
Normally, SET SOFTSEEK is turned OFF (<lSoftSeek>==.F.) ), causing the 
record pointer to be positioned on the "phantom" record if <IndexKeyValue> 
is not found in the index file (for DBF files this corresponds to the 
position LastRec()+1). The function Found() then returns the value .F. and 
the function Eof() returns the value .T. If SET SOFTSEEK is turned ON 
(<lSoftSeek>==.T.) ) an "inexact" search is performed. This results in the 
record pointer being positioned on the first record whose value is greater 
than <IndexKeyValue> . If such a record exists, the function Found() and the 
function Eof() both return the value .F. (false).
<endsnip>

In a nutshell.

If DbSeek("X",TRUE) .or. !Eof()
     Identical record or next record found
else
     No such record, and no next record
endif


Regards,
Jack Duijf



"Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> schreef in bericht 
news:6ce6f0d3$29423377$25aa@news.alaska-software.com...
> Hi,
>    In this new version I have been getting a error on dbSEEK() when
> second parameter (lSoftSeek = .T..
>
>    In all cases, after dbseek() if I test Found(), it returns .F....
>    Any people experiment this error.. ?
>
>    Thanks,
>    Osvaldo L Aoki
Osvaldo Luis AokiRe: dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
on Fri, 19 Jun 2009 18:07:09 -0300
HI Jack,

    I think, then, I did a wrong interpretation about Softseek...

    I Thought when Softseek = ON and eof() = .f., then
found() is True, considering softseek = on....

    Anyway, this question is passed to Alaska to analyse...
I think this is a concept question.

    Thanks,

    Osvaldo L Aoki


"Jack Duijf" escreveu na mensagem 
news:20b19932$5c22dd89$e93@news.alaska-software.com...
> Hello All.
>
> As of the Alaska docs DbSeek():
> <snip>
> The return value of DbSeek() is .T. (true) when the specified value was 
> found in the active index file. Otherwise it is .F. (false).
>
> If the value of <IndexKeyValue> is not found in the index file, the 
> position of the record pointer depends on <lSoftSeek> or on the SET 
> SOFTSEEK setting. Normally, SET SOFTSEEK is turned OFF 
> (<lSoftSeek>==.F.) ), causing the record pointer to be positioned on the 
> "phantom" record if <IndexKeyValue> is not found in the index file (for 
> DBF files this corresponds to the position LastRec()+1). The function 
> Found() then returns the value .F. and the function Eof() returns the 
> value .T. If SET SOFTSEEK is turned ON (<lSoftSeek>==.T.) ) an "inexact" 
> search is performed. This results in the record pointer being positioned 
> on the first record whose value is greater than <IndexKeyValue> . If such 
> a record exists, the function Found() and the function Eof() both return 
> the value .F. (false).
> <endsnip>
>
> In a nutshell.
>
> If DbSeek("X",TRUE) .or. !Eof()
>     Identical record or next record found
> else
>     No such record, and no next record
> endif
>
>
> Regards,
> Jack Duijf
>
>
>
> "Osvaldo Luis Aoki" <osvaldo@aoki-sis.com.br> schreef in bericht 
> news:6ce6f0d3$29423377$25aa@news.alaska-software.com...
>> Hi,
>>    In this new version I have been getting a error on dbSEEK() when
>> second parameter (lSoftSeek = .T..
>>
>>    In all cases, after dbseek() if I test Found(), it returns .F....
>>    Any people experiment this error.. ?
>>
>>    Thanks,
>>    Osvaldo L Aoki
>
Rodd Graham Re: dbSeek( ckey, .t.) cause not Found in Alaska 1.9.355
on Sat, 20 Jun 2009 08:58:02 +0000
Hello Osvaldo,

> I think, then, I did a wrong interpretation about Softseek...
> 
> I Thought when Softseek = ON and eof() = .f., then found() is
> True, considering softseek = on....
> 

Found() returns the same value as the most recent dbseek() which is only 
true if the SEEKed key value exists in the index.

Softseek only affects what the current record is when the SEEKed key value 
is not found in the index.

This is the behavior compatible with Clipper.  

Additionally, I fail to see what logic you are implementing that would require 
a different behavior of SOFTSEEK.  Either the key value you SEEKed is found() 
and the current record is that key value OR it was not found() and the current 
record is the record in the index with the next highest value in the index 
sort order (which might be eof() if no row has a higher value).

What situation are you trying to detect or database operation are you trying 
to accomplish?  There is nothing new under the sun with respect to xBase 
databases and I am sure that you will get a solution pattern if you describe 
your database scenario on the NG.

Regards,

Rodd Graham, Consultant
Graham Automation Systems, LLC