Click or drag to resize

ClassName Function

X#
Get the class name of an object.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION ClassName(
	oObject AS Object
) AS STRING
Request Example View Source

Parameters

oObject
Type: Object
An object whose class name you want to get.

Return Value

Type: String
The class to which oObject belongs.
If oObject is not an instance of a class, a NULL_SYMBOL is returned.
Remarks
Examples
These examples illustrate ClassName():
X#
 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{"Ms.", "Wonderful"}
13    IF ClassName(oY)    = #Female                            
14        ? "The woman belongs to the Female class."
15    ENDIF
See Also