Click or drag to resize

CSend Function

X#
Invoke a method.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION CSend(
	oObject AS Object,
	symMethod AS STRING,
	MethodArgList PARAMS USUAL[]
) AS USUAL
Request Example View Source

Parameters

oObject
Type: Object
The object whose method is invoked.
symMethod
Type: String
The method name, specified without parentheses.
MethodArgList
Type: Usual
A comma-separated list of arguments to pass to symMethod.

Return Value

Type: Usual
The return value of the method.
Remarks
Send() allows you to send a method through a function call.
Examples
This example uses Send() to invoke a method named Horn() that expects two arguments:
X#
 1CLASS Automobile
 2    EXPORT model
 3CONSTRUCTOR(tmodel) CLASS Automobile
 4    model := tmodel
 5METHOD Horn(nSound, cSay) CLASS Automobile
 6    Tone(nSound, 2)
 7    QOut(cSay)
 8FUNCTION Start()
 9    LOCAL x AS OBJECT
10    x := Automobile{"Car"}
11    // x:Horn(100, "Hello!")
12    Send(x, #Horn, 100, "Hello!")
See Also