FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse Question
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
xBrowse Question
Posted: Fri Aug 17, 2012 02:02 PM

Hi,

I have an xBrowse on a DBF or SQL table and I allow the users to select multiple records (oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS)

As the users select records, is there a way I can add up values in fields/columns of the selected records (or add up values of relating records in another table) and display the values in a field on the dialog?

Thanks in advance

Pete

Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: xBrowse Question
Posted: Fri Aug 17, 2012 03:33 PM

Peter;

The selected xbrowse record ::bKeyNo value is saved on ::aSelected property of xbrowse.

So, here is an idea:

x := 0
bAddBlock := { |nRecNo| oDbf:Goto( nRecNo ), x += oDbf:SomeValue }
AEVAL( oBrw:aSelected, { |e| EVAL( bAddBlock, e } )

Reinaldo.

Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse Question
Posted: Tue Aug 21, 2012 03:21 PM

Not too sure I know where in my code to put your example.

I have tried putting a calculation routine into bChange which nearly works - as you have to move after you have selected the record for the calculation/aSelected to be updated.

Any ideas where I should put my total update routine?

Pete

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse Question
Posted: Tue Aug 21, 2012 03:46 PM

The real problem is that the calling program does not know when the user selected or deselected a row. bChange does not report this.

I suggest a new DATA bOnMultiSelect for XBrowse which will be called at the end of METHOD Select( nOption ).

You can try this modification.

Regards



G. N. Rao.

Hyderabad, India
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: xBrowse Question
Posted: Tue Aug 21, 2012 03:55 PM

Ok, I'll try that

Thanks for your help

Pete

Continue the discussion