Xbasic
DotNet::Services.CallStaticFunction Method
Syntax
dim Result as L = CallStaticFunction(FullyQualifiedFunctionName as C, OPTIONAL Assembly as DotNet::AssemblyReference = null_value(), PARAMS Arguments as A)
Arguments
- FullyQualifiedFunctionNameCharacter
- AssemblyDotNet::AssemblyReference
- ArgumentsAny Type
Returns
- ResultLogical
A .t. or .f. value indicating whether or not the call to the static function succeeded. The DotNet::Services CallResult property will contain additional information about the error.
Description
Use CallStaticFunction() to call a static/class function in an arbitrary .NET class without having to register the assembly in the Alpha Anywhere type system.
Example
Calling a static function in a system class that is registered in the global assembly cache (GAC).
Dim FunctionName as C = "System::DateTime::DaysInMonth"
Dim Services as DotNet::Services
If .not. Services.CallStaticFunction(FunctionName, 1959, 2)
UI_Msg_Box("Error calling function " + FunctionName, \
Services.CallResult.Text)
Else
UI_Msg_Box("Function " + FunctionName + \
" returned the following value", "" + \
Services.CallResult.ResultDataValue)
End if