problem to erase rows of xbrowse - RESOLVED

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

problem to erase rows of xbrowse - RESOLVED

Post by Silvio.Falconi »

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.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: problem to erase rows of xbrowse

Post by cnavarro »

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


 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

 
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem to erase rows of xbrowse

Post by Silvio.Falconi »

no I tried also with

Code: Select all

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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem to erase rows of xbrowse

Post by Silvio.Falconi »

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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: problem to erase rows of xbrowse

Post by cnavarro »

Add the first line again
Add (oBrowse: aArrayData, {...................})
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem to erase rows of xbrowse

Post by Silvio.Falconi »

is it a Joke ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: problem to erase rows of xbrowse

Post by Otto »

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

********************************************************************
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: problem to erase rows of xbrowse

Post by nageswaragunupudi »

The best way is:

Code: Select all

ASize( oBrw:aArrayData, 0 )
oBrw:MakeTotals()
oBrw:Refresh()
 
This is also possible

Code: Select all

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

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

Re: problem to erase rows of xbrowse

Post by nageswaragunupudi »

The best way is:

Code: Select all

ASize( oBrw:aArrayData, 0 )
oBrw:MakeTotals()
oBrw:Refresh()
 
This is also possible

Code: Select all

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

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem to erase rows of xbrowse

Post by Silvio.Falconi »

Nages,
I Wish no erase the First row of array
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
FranciscoA
Posts: 1964
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: problem to erase rows of xbrowse

Post by FranciscoA »

Silvio, try this way.

Code: Select all

//---------------------------//
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.

Fwxh1204-MySql-TMySql
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: problem to erase rows of xbrowse

Post by nageswaragunupudi »

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

Code: Select all

ASize( oBrw:aArrayData, 1 )
oBrw:MakeTotals()
oBrw:Refresh()
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: problem to erase rows of xbrowse

Post by Silvio.Falconi »

good I resolved
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply