FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour problem with XBROWSE with SELECT clause
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
problem with XBROWSE with SELECT clause
Posted: Mon Sep 22, 2008 03:21 PM
I should list a few record via XBROWSE.
I saw the clause SELECT, but it doesn't work rightly and i don't understand why. This is my code:


local oBRW,oDLG 
use clienti 
index on importo to custntx 
DEFINE DIALOG oDLG RESOURCE "PROVA" 
redefine XBROWSE oBRW ID 101 of oDLG FIELDS clienti->ragsoc,clienti->importo ; 
      SELECT IMPORTO FOR 1000 TO 1000 ; 
      FIELDSIZES 150,150 ; 
      HEADERS "RAGIONE SOCIALE","IMPORTO" 
ACTIVATE DIALOG oDLG CENTERED


In this way, the xbrowse works with all record without filtering the records with importo=1000 as i want.
I did not found examples in \fwh\samles: someone can help me?
Thank you.


FWH 8.04 - XHARBOUR 1.1.0
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
problem with XBROWSE with SELECT clause
Posted: Mon Sep 22, 2008 04:36 PM

Why don't you just use scopes? If you don't know how, let me know.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
problem with XBROWSE with SELECT clause
Posted: Mon Sep 22, 2008 04:43 PM

James,
how can i use scopes?
I don't know how.
Can you write me an example?
Thank you.

Max

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
problem with XBROWSE with SELECT clause
Posted: Mon Sep 22, 2008 05:27 PM

Using Scopes

The database must be indexed on the field to be scoped.

Then to set the top scope:
(cAlias)->( ordScope( 0, uTopScope) )

To set the bottom scope:
(cAlias)->( ordScope( 1, uBottomScope) )

Then you should do a go top:
(cAlias)->(dbgotop())

You can use the same value for both the top and bottom scope.

This works with both NTX and CDX indexes.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 130
Joined: Fri Jun 30, 2006 02:14 PM
problem with XBROWSE with SELECT clause
Posted: Mon Sep 22, 2008 05:33 PM

Thank you James, all cleared!

Max

Continue the discussion