problem with XBROWSE with SELECT clause

problem with XBROWSE with SELECT clause

Postby max » Mon Sep 22, 2008 3: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:


Code: Select all  Expand view
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
Code: Select all  Expand view
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Postby James Bott » Mon Sep 22, 2008 4:36 pm

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

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

Postby max » Mon Sep 22, 2008 4:43 pm

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

Max
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy

Postby James Bott » Mon Sep 22, 2008 5: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby max » Mon Sep 22, 2008 5:33 pm

Thank you James, all cleared!

Max
User avatar
max
 
Posts: 128
Joined: Fri Jun 30, 2006 2:14 pm
Location: Ancona - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 63 guests