Functions.CreateInstance 方法 |
命名空间: XSharp.RT
FUNCTION CreateInstance( symClassName, InitArgList ) AS Object CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })] public static Object CreateInstance( __Usual symClassName = default, __Usual InitArgList = default )
1CLASS Person 2 EXPORT name, sign 3CONSTRUCTOR(tName, tSign) 4 name := tName 5 sign := tSign 6END CLASS 7 8FUNCTION Start() 9 LOCAL x AS OBJECT 10 // 将类名作为符号传递,并且 11 // 指定所有 Init() 方法参数。 12 x := CreateInstance(#PERSON, "Odile", "H") 13 ? x:name // Odile