MULTISELECT RECORDSET

MULTISELECT RECORDSET

Postby Jack » Fri Jun 25, 2021 2:18 pm

Hi,
I can use multiselect with xbrowse of recordset
*
How to go to each record select and do Something

What is the syntax ?

wac := oLbx:aSelected

for i = 1 to len (wac)
*** ???
next

Thanks for your help .

Philippe
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Re: MULTISELECT RECORDSET

Postby nageswaragunupudi » Sat Jun 26, 2021 3:21 am

Code: Select all  Expand view

oBrw:lScreenUpdating := .f.
oBrw:Refresh()
//
uSaveBm := oBrw:oRs:BookMark
for i := 1 to Len( oBrw:aSelected )
  oBrw:oRs:BookMark := oBrw:aSelected[ i ]
  // do anything with the current record of the recordset
  // during this loop do not refresh browse
next
oBrw:oRs:BookMark := uSaveBm
//
oBrw:lScreenUpdating := .t.
oBrw:Refresh()
 


Another way:

Code: Select all  Expand view

oBrw:lScreenUpdating := .f.
oBrw:Refresh()
//
uSaveBm := oBrw:oRs:BookMark
cFilter := oBrw:oRs:Filter
oBrw:oRs:Filter := oBrw:aSelected
oBrw:oRs:MoveFirst()
do while !oBrw:oRs:Eof()
   // do your work
   oBrw:oRs:MoveNext()
enddo
oBrw:oRs:MoveFirst()
oBrw:Filter := cFilter
oBrw:oRs:BookMark := uSaveBm
//
oBrw:lScreenUpdating := .t.
oBrw:Refresh()
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MULTISELECT RECORDSET

Postby Marc Venken » Sat Jun 26, 2021 7:59 am

oBrw:lScreenUpdating := .F.

First time i see this one...

I suppose it is adviced for the moments that we process xbrowse records like the sample posted here ?

but where is it build for ? are there more situations its use is better ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1425
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: MULTISELECT RECORDSET

Postby Jack » Sat Jun 26, 2021 8:59 am

Thanks for your help .

Here is the code that work for me .

oRs:Filter := oLbx:aSelected
oRs:MoveFirst()
do while !oRs:Eof()
msgalert(oRs:Fields(1):Value)
oRs:MoveNext()
enddo

Thanks

Philippe
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am


Return to FiveWin for Harbour/xHarbour

Who is online

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

cron