xBrowse Question

Post Reply
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

xBrowse Question

Post by PeterHarmes »

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
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: xBrowse Question

Post by reinaldocrespo »

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.
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse Question

Post by PeterHarmes »

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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse Question

Post by nageswaragunupudi »

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
PeterHarmes
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: xBrowse Question

Post by PeterHarmes »

Ok, I'll try that

Thanks for your help

Pete
Post Reply