Functions.Object2Array 方法 |
命名空间: XSharp.RT
FUNCTION Object2Array( oObject AS Object ) AS ARRAY
public static __Array Object2Array( Object oObject )
1CLASS Person 2 EXPORT name 3 INSTANCE grade 4 PROTECT password 5CONSTRUCTOR(tname, tgrade, tpassword) 6 name := tname 7 grade := tgrade 8 password := tpassword 9END CLASS 10FUNCTION Start() 11 LOCAL x AS OBJECT 12 LOCAL a AS ARRAY 13 LOCAL i AS SHORT 14 x := Person{"Randal", "A", "123"} 15 a := Object2Array(x) 16 // 打印它们 17 FOR i := 1 UPTO ALen(a) 18 QOut(a[i]) 19 NEXT 20 // Randal 21 // A