problem to erase rows of xbrowse - RESOLVED

problem to erase rows of xbrowse - RESOLVED

Postby Silvio.Falconi » Thu Nov 21, 2019 11:07 am

I must erase all rows of a xbrowse ( array) but not the first rows I made

For n=1 to Len(oBrowse:aArrayData)
IF ! n = 1 // oBrowse:nArrayAt = 1
ADel( oBrowse:aArrayData, n, .t. )
oBrowse:MakeTotals()
oBrowse:Refresh()
CalcoloTotali2(oBrowse,aGet,@nSconto,@nSubtotale,@nTotale)
endif
next

but erase only the last row

how I can resolve i t?
Last edited by Silvio.Falconi on Sun Nov 24, 2019 11:33 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem to erase rows of xbrowse

Postby cnavarro » Thu Nov 21, 2019 11:31 am

Silvio.Falconi wrote:I must erase all rows of a xbrowse ( array) but not the first rows I made

For n=1 to Len(oBrowse:aArrayData)
IF ! n = 1 // oBrowse:nArrayAt = 1
ADel( oBrowse:aArrayData, n, .t. )
oBrowse:MakeTotals()
oBrowse:Refresh()
CalcoloTotali2(oBrowse,aGet,@nSconto,@nSubtotale,@nTotale)
endif
next

but erase only the last row

how I can resolve i t?


This not run ?
Code: Select all  Expand view  RUN


 For n=1 to Len(oBrowse:aArrayData)
    IF ! n = 1 // oBrowse:nArrayAt = 1
           //ADel( oBrowse:aArrayData, n, .t. )
           oBrowse:SetPos( 2, 1 )
           oBrowse:Delete()
           //oBrowse:MakeTotals()
           //oBrowse:Refresh()
           CalcoloTotali2(oBrowse,aGet,@nSconto,@nSubtotale,@nTotale)
         endif
       next

 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: problem to erase rows of xbrowse

Postby Silvio.Falconi » Thu Nov 21, 2019 12:12 pm

no I tried also with

Code: Select all  Expand view  RUN
Static Function DeleteAllRows( oBrowse,aGet )
   Local n
   if msgYesNo( i18n("¿ E' sicuro che devo cancellare tutto ?") )
    if ! Empty( oBrowse:aArrayData )
       For n=1 to Len(oBrowse:aArrayData)
          IF ! n = 1
              oBrowse:SetPos( n, 1 )
           oBrowse:Delete()
         //  ADel( oBrowse:aArrayData, n, .t. )
         // oBrowse:MakeTotals()
         // oBrowse:Refresh()
          //CalcoloTotali2(oBrowse,aGet,@nSconto,@nSubtotale,@nTotale)
         endif
       next n
     Endif
Endif

return nil
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem to erase rows of xbrowse

Postby Silvio.Falconi » Thu Nov 21, 2019 12:20 pm

Cristobal
on oldest function run ok

Static Function DeleteAllRows( oBrowse,aGet )
if msgYesNo( i18n("¿ E' sicuro che devo cancellare tutto ?") )
if ! Empty( oBrowse:aArrayData )
aSize( oBrowse:aArrayData, 0 )
oBrowse:Refresh()
oBrowse:MakeTotals()
CalcoloTotali(oBrowse,aGet)
endif
Endif
return nil


but it erase all records
I wish no erase the first row
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem to erase rows of xbrowse

Postby cnavarro » Thu Nov 21, 2019 1:36 pm

Add the first line again
Add (oBrowse: aArrayData, {...................})
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: problem to erase rows of xbrowse

Postby Silvio.Falconi » Thu Nov 21, 2019 3:17 pm

is it a Joke ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem to erase rows of xbrowse

Postby Otto » Thu Nov 21, 2019 6:06 pm

Silvio, I will remember that xBrowse needs a minimum of 1 entry.
Regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6335
Joined: Fri Oct 07, 2005 7:07 pm

Re: problem to erase rows of xbrowse

Postby nageswaragunupudi » Thu Nov 21, 2019 7:29 pm

The best way is:
Code: Select all  Expand view  RUN

ASize( oBrw:aArrayData, 0 )
oBrw:MakeTotals()
oBrw:Refresh()
 


This is also possible
Code: Select all  Expand view  RUN

do while oBrw:nLen > 0
   oBrw:Delete()
enddo
 
Regards

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

Re: problem to erase rows of xbrowse

Postby nageswaragunupudi » Thu Nov 21, 2019 7:29 pm

The best way is:
Code: Select all  Expand view  RUN

ASize( oBrw:aArrayData, 0 )
oBrw:MakeTotals()
oBrw:Refresh()
 


This is also possible
Code: Select all  Expand view  RUN

do while oBrw:nLen > 0
   oBrw:Delete()
enddo
 
Regards

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

Re: problem to erase rows of xbrowse

Postby Silvio.Falconi » Thu Nov 21, 2019 9:06 pm

Nages,
I Wish no erase the First row of array
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem to erase rows of xbrowse

Postby FranciscoA » Thu Nov 21, 2019 11:43 pm

Silvio, try this way.
Code: Select all  Expand view  RUN
//---------------------------//
function Borrando(aArray,oBrw)
local n
oBrw:nArrayAt := 2
For n := 2 to oBrw:nLen
   ADel( aArray, oBrw:nArrayAt, .f. )
   ASize(aArray,1)
   oBrw:Refresh()
Next
Return nil
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2159
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: problem to erase rows of xbrowse

Postby nageswaragunupudi » Fri Nov 22, 2019 2:39 am

Silvio.Falconi wrote:Nages,
I Wish no erase the First row of array


Code: Select all  Expand view  RUN
ASize( oBrw:aArrayData, 1 )
oBrw:MakeTotals()
oBrw:Refresh()
 
Regards

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

Re: problem to erase rows of xbrowse

Postby Silvio.Falconi » Sat Nov 23, 2019 10:14 am

good I resolved
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Marc Venken and 87 guests