Page 1 of 1
xBrowse - dbSeek
Posted: Fri Sep 18, 2009 1:08 pm
by Otto
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
Re: xBrowse - dbSeek
Posted: Fri Sep 18, 2009 3:30 pm
by James Bott
Otto,
With what error?
You should either be using alias referencing or better, a database object.
James
Re: xBrowse - dbSeek
Posted: Fri Sep 18, 2009 4:59 pm
by Otto
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
Re: xBrowse - dbSeek
Posted: Fri Sep 18, 2009 8:59 pm
by James Bott
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
Re: xBrowse - dbSeek
Posted: Sat Sep 19, 2009 4:36 am
by nageswaragunupudi
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.