xBrowse - dbSeek

xBrowse - dbSeek

Postby Otto » Fri Sep 18, 2009 1:08 pm

If there is no index order selected and you use
oxBrw:bSeek := {|c| DbSeek( Upper( c ) ) }
xBrowse crashes.

Perhaps xBrowse could handle this.

I use
oxBrw:bSeek := {|c| iif( indexord() > 0,;
DbSeek( Upper( c ) ) ,( msginfo("keine Sortierung ausgewählt"), .f.) ) }

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: xBrowse - dbSeek

Postby James Bott » Fri Sep 18, 2009 3:30 pm

Otto,

With what error?

You should either be using alias referencing or better, a database object.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: xBrowse - dbSeek

Postby Otto » Fri Sep 18, 2009 4:59 pm

Hello James,
thank you for your answer.
Workarea not in use.
I only think that xBrowse should handle such input errors and act like a blackbox.

You can reproduce what I mean if you insert a
set order to

before:
oxBrw:bSeek := {|c| DbSeek( Upper( c ) ) }

Best regards,
Otto



Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: xBrowse - dbSeek

Postby James Bott » Fri Sep 18, 2009 8:59 pm

Otto,

Try this:

oxBrw:bSeek := {|c| (::cAlias)->(DbSeek( Upper( c ) )) }

Take a look at TXBrowse:setRDD(). If you use that and set lAutoOrder =.t. then you bSeek will be set automatically by xbrowse.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: xBrowse - dbSeek

Postby nageswaragunupudi » Sat Sep 19, 2009 4:36 am

oxBrw:bSeek := {|c| (::cAlias)->(DbSeek( Upper( c ) )) }

Even this fails if no order is set.

XBrowse assigns a default bSeek only when lAutoOrder is specified. When we specify lAutoOrder, it is better to leave the responsibility of defining bSeek to XBrowse.

If lAutoOrder is not specified and incremental search is desired, it is the responsibility of the programmer to specify a safe and appropriate codeblock for bSeek, taking care of the appropriate alias, checking indexorder, etc.

XBrowse supports any kind of data collection, not necessarily the well known dbf, array, recset, etc.
So when the codeblocks are directly defined by the programmer, he is expected to take full responsibility of the necessary checks.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests