Functions.ClassName 方法 |
命名空间: XSharp.RT
FUNCTION ClassName( oObject AS Object ) AS STRING
public static string ClassName( Object oObject )
1CLASS Person 2 EXPORT cName, cSign 3CONSTRUCTOR(tName, tSign) 4 cName := tName 5 cSign := tSign 6END CLASS 7CLASS Female INHERIT Person 8 EXPORT prefers 9END CLASS 10FUNCTION CheckClass() 11 LOCAL oY AS OBJECT 12 oY := Female{"女士", "精彩"} 13 IF ClassName(oY) = #Female 14 ? "这位女士属于 Female 类。" 15 ENDIF