FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Change oBrw:aSelected outsite xbrowse
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Change oBrw:aSelected outsite xbrowse
Posted: Fri Mar 19, 2021 03:58 PM

Can we change the status of aSelected?

The idea is that I call several functions (one by one) with a different ordscope() selection. The result records of that selection should be set to .t. in de aSelected
Next again a ordscope with other results, but these also need to be set .t. in aselected.
etc...

Finaly all selections are made and oBrw:aSelected contains all record from different searches/selections.

redraw of xbrowse should show all the records in aSelected.

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Change oBrw:aSelected outsite xbrowse
Posted: Fri Mar 19, 2021 07:07 PM
Purpose of oBrw:aSelected is totally different.
What you want is you prepare an array of record numbers, which you want to show in xbrowse.

In this sample, aRecs represent the array aSelected you are referring to:

Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oDlg, oFont, oBrw
   local aRecs    := { 3, 10, 20 }

   USE STATES
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 400,300 PIXEL TRUEPIXEL FONT oFont ;
      TITLE "FILTER BY ARRAY"

   @ 80,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE "STATES" ;
      COLUMNS "RECNO()", "CODE", "NAME" ;
      HEADERS "REC" PICTURES "999" ;
      CELL LINES NOBORDER ;
      ROWS aRecs

   oBrw:CreateFromCode()

   @ 20,20 BUTTON "CHANGE RECORDS" SIZE 200,40 PIXEL OF oDlg ;
      ACTION ( oBrw:aArrayData := { 3, 10, 20, 7, 23, 47 }, oBrw:Refresh() )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil


Regards



G. N. Rao.

Hyderabad, India
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Change oBrw:aSelected outsite xbrowse
Posted: Sat Mar 20, 2021 10:02 AM

Thanks for sending me in the correct direction !!

In every lookup function (afther selection)
I will add records to the array with a dbeval(....aadd()..)

Marc Venken

Using: FWH 23.08 with Harbour

Continue the discussion