FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse & SELECT parameter
Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
xBrowse & SELECT parameter
Posted: Sun Mar 22, 2015 04:06 PM

I am working in conversion of old FW & Clipper systems.
I just discovered that the SELECT clause in REDEFINE XBROWSE is accepted but not processed. (I tested with several FWH versions)
Discovered also that oBrw:SetFilter("field", <field>) does not exist in xBrowse.
In this case, there are NTX index files. (cannot use ordscope).
Any suggestions?
TIA Euclides.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse &amp; SELECT parameter
Posted: Mon Mar 23, 2015 02:50 AM

This feature is not available in XBrowse.

Regards



G. N. Rao.

Hyderabad, India
Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
Re: xBrowse &amp; SELECT parameter
Posted: Mon Mar 23, 2015 11:46 AM
Hi, sorry for hearing that... In this case, I suggest to elininate the line:
Code (fw): Select all Collapse
[ SELECT <cField> FOR <uValue1> [ TO <uValue2> ] ] ;

from the DEFINE & REDEFINE statements in th XBROWSE.CH
I will keep using TWBROWSE
Regards, Euclides
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse &amp; SELECT parameter
Posted: Mon Mar 23, 2015 12:55 PM

It is your choice to use xbrowse or wbrowse.

We did not implement in xbrowse because now ORDSCOPE() works for DBFNTX also and this is a lot better than implementation inside browse logic.

ORDSCOPE( 0, "B" )
ORDSCOPE( 1, "D" )
GO TOP

and XBrowse.
This is quite efficient

Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: xBrowse &amp; SELECT parameter
Posted: Mon Mar 23, 2015 01:46 PM

You should consider moving to CDXs--they all exist in one file and you can globally set them to open automatically whenever you open the DBF.

Better yet, you should consider moving to database objects--no more using aliases or work areas. You can eliminate lots of code this way. This provides easier to read code with less bugs, and it is easier to maintain.

oCustomer:= TCustomer():New( cCustNo )

msgInfo( oCustomer:balance() )

How easy is that?

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse &amp; SELECT parameter
Posted: Mon Mar 23, 2015 01:56 PM
James Bott wrote:You should consider moving to CDXs--they all exist in one file and you can globally set them to open automatically whenever you open the DBF.

Better yet, you should consider moving to database objects--no more using aliases or work areas. You can eliminate lots of code this way. This provides easier to read code with less bugs, and it is easier to maintain.

oCustomer:= TCustomer():New( cCustNo )

msgInfo( oCustomer:balance() )

How easy is that?

Mr James.
Your advise is good. But every programmer here has already running applications with large code. It is not so easy to convert the entire project to oops or even converting from ntx to cdx.

They need simple solution to work without undertaking a major change.

Using OrdScope() is much simpler for dbfntx also.

I am considering why not we translate the SELECT .... clause in xbrowse to apply OrdScope() inside the xbrowse.prg which makes it easier for migration from wbrowse to xbrowse. May be we provide this in the next release.
Regards



G. N. Rao.

Hyderabad, India
Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
Re: xBrowse &amp; SELECT parameter
Posted: Mon Mar 23, 2015 02:03 PM

Thanks Mr.Rao. I was not aware about using ORDSCOPE with DBFNTX.
But let me insist...
in XBROWSE.CH, in the statement #xcommand:

xcommand @ <nRow>, <nCol> [ COLUMN ] XBROWSE <oBrw> ;

... the line:
[ SELECT <cField> FOR <uValue1> [ TO <uValue2> ] ] ;
should be deleted
Your thougths please...
Regards, Euclides

Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
Re: xBrowse &amp; SELECT parameter
Posted: Mon Mar 23, 2015 02:18 PM

Hi James, thanks for the info...
As I stated in the beggining, I am converting an old FiveWin-Clipper app.
I used (until today in smal systems) to load the DBF into an Array and after the dialog, load it back to DBF (scatter & gather functions).
Would be a lot of work rewrite it to use TDatabase
In the newest systems, I am using TDatabase extesively.
Regards, Euclides

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse &amp; SELECT parameter
Posted: Mon Mar 23, 2015 04:44 PM

For your information, class TDataRow is created to be used in the place of scatter/gather logic, but this class is robust and safer. We can also address the fieldnames as oRec:fieldname.

TDataRow works with DBF, TDatabase, ADO Recordset, TRecSet, DolphinQry exactly the same way.

Regards



G. N. Rao.

Hyderabad, India
Posts: 159
Joined: Wed Mar 28, 2007 01:19 PM
Re: xBrowse &amp; SELECT parameter
Posted: Tue Mar 24, 2015 12:33 PM

Thanks Mr. Rao
Regards, Euclides

Posts: 153
Joined: Tue Aug 05, 2014 09:48 AM
Re: xBrowse &amp; SELECT parameter
Posted: Tue Mar 24, 2015 01:08 PM
nageswaragunupudi wrote:For your information, class TDataRow is created to be used in the place of scatter/gather logic, but this class is robust and safer. We can also address the fieldnames as oRec:fieldname.

TDataRow works with DBF, TDatabase, ADO Recordset, TRecSet, DolphinQry exactly the same way.

Nice for info
Dear Rao,
Any link / working small example, please
Regards, Greetings



Try FWH. You will enjoy it's simplicity and power.!

Continue the discussion