From f8cd97f6c9a4dd71afeccdd806efa1c4ba8eece7 Mon Sep 17 00:00:00 2001 From: Eddie Runia Date: Sat, 8 May 1999 19:58:08 +0000 Subject: [PATCH] aoMethod( ) added to debugtst.prg Function creates an array containing all the methods present in an object. Same methodology as aoData( ) --- harbour/tests/working/debugtst.prg | 33 ++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/harbour/tests/working/debugtst.prg b/harbour/tests/working/debugtst.prg index 4a1f28ef8e..911edb2454 100644 --- a/harbour/tests/working/debugtst.prg +++ b/harbour/tests/working/debugtst.prg @@ -326,6 +326,29 @@ function aOData( oObject ) return aData + +// +// aData aOMethod( oObject ) +// +// Return an array containing the names of all the method of oObject. +// +function aOMethod( oObject ) + + local aInfo := aSort( oObject:ClassSel() ) + local aMethod := {} + local n := 1 + local nLen := Len( aInfo ) + + do while n <= nLen .and. Substr( aInfo[ n ], 1, 1 ) != "_" + if Empty( aScan( aInfo, "_" + aInfo[ n ], n + 1 ) ) + aAdd( aMethod, aInfo[ n ] ) + endif + n++ + enddo + +return aMethod + + // // aOGet( , [] ) // @@ -362,14 +385,8 @@ return aData // function aOSet( oObject, aData ) - local n - local nLen := Len( aData ) -// aEval( aData, ; // aEval looses memory blocks -// {|aItem| oSend( oObject, "_"+aItem[DATA_SYMBOL], aItem[DATA_VAL] ) } ) - - for n:= 1 to nLen - oSend( oObject, "_"+aData[n][DATA_SYMBOL], aData[n][DATA_VAL] ) - next n + aEval( aData, ; + {|aItem| oSend( oObject, "_"+aItem[DATA_SYMBOL], aItem[DATA_VAL] ) } ) return oObject