Functions.ASend 方法 |
命名空间: XSharp.RT
FUNCTION ASend( aTarget AS ARRAY, symMethod AS STRING, MethodArgList PARAMS USUAL[] ) AS ARRAY
public static __Array ASend( __Array aTarget, string symMethod, params __Usual[] MethodArgList )
1CLASS Greet 2METHOD Salut(cRest) CLASS Greet 3 ? "Hello", cRest 4 RETURN 5END CLASS 6FUNCTION Start() 7 LOCAL oAlpha, oBeta, oGamma, oDelta, oEpsilon ; 8 AS OBJECT 9 LOCAL aBunch AS ARRAY 10 oAlpha := Greet{} 11 oBeta := Greet{} 12 oGamma := Greet{} 13 oDelta := Greet{} 14 oEpsilon := Greet{} 15 aBunch := {oAlpha, oBeta, oGamma, oDelta, oEpsilon} 16 ASend(aBunch, #Salut, "world") 17 // 等效输出 18 AEval(aBunch, {|aTemp| aTemp:Salut("world")})