//returns array
// map( <xFunc, [,aArg1] [, aArgN])
function aMap(...)
local aOut := {}
local aTemp
local aArgs := hb_aParams()
local nArgCount := len(aArgs) // func is the first arg so skip it.
local xFunc := iif(len(aArgs)>0,aArgs[1],nil)
local nArgInd
local lObject := hb_isObject(xFunc)
local nArgStart := iif(lObject,3,2)
local nResCount := iif(nArgCount>1,len(aArgs[2]),0)
local nResInd
local oObj := iif(lObject,xFunc,nil)
if lObject
xFunc := aArgs[2]
endif
for nResInd:=1 to nResCount
aTemp := {}
for nArgInd:=nArgStart to nArgCount
aAdd(aTemp,aArgs[nArgInd][nResInd])
next
if lObject
aAdd(aOut, HB_ExecFromArray(oObj,xFunc,aTemp))
else
aAdd(aOut, HB_ExecFromArray(xFunc,aTemp))
endif
next
return aOut