how I can del an element of a array and refresh the array ?
I have a array aData sample
56,.t.
102,.f.
103,.f.
I want delete only the array element with .t. and refresh the array aData
AEval( AClone( aData ), { |a,i| If( a[ 2 ], ADel( aData, i, .t. ), ) } )
hua wrote:Take note, in Rao's code, ADel() has 3 parameter. The 3rd parameter is an xHarbour extension which I think is not supported by Harbour
The function in xhb.lib that does the job is named xhb_adel()nageswaragunupudi wrote:This works with Harbour too. Just link xhb.lib. Harbour make file in samples folder includes this lib
#include "Fivewin.ch"
#ifndef __XHARBOUR__
#include "xhb.ch"
#endif
function main()
local aData := { { 1, .t. }, { 2, .f. }, { 3, .t. }, { 4, .f. } }
local n := 1
xbrowse( aData )
AEval( AClone( aData ), { |a,i| If( a[ 2 ], ADel( aData, n, .t. ), n++ ) } )
xbrowse( aData )
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 83 guests