NextOverloadMethod

Applies to:Fast Math Parser
Class:uCalc.Item
Returns next uCalc.Item object that shares the same name
Syntax
NextOverload()
Remarks
If several functions, operators, parameters, etc are overloaded -- that is they are defined with different parameters but share the same name --, or if they (or variables) overshadow each other, this function returns the next uCalc.Item object that shares the same name.
Example 1: returning data type names for the different definitions of the "+" operator

Dim PlusOperator = uc.GetItemOf("+")

while PlusOperator.ItemHandle <>  0 

   Console.WriteLine("Def: " + PlusOperator.Text() + "  Type: " + PlusOperator.GetDataType().Name())
   PlusOperator = PlusOperator.NextOverload()
End while

' Output
' Def: Operator_: 70 +{x}  Type: double
' Def: Operator_: 50 {x} + {y}  Type: double
' Def: Operator_: 50 {x As Int32} + {y As Int32} As Int32  Type: Int32
' Def: Operator_: 50 {x As String} + {y As String} As String  Type: string
' Def: Operator_: 50 {x} + {y As Complex} As Complex  Type: complex
' Def: Operator_: 50 {x As Complex} + {y} As Complex  Type: complex
' Def: Operator_: 50 {x As Complex} + {y As Complex} As Complex  Type: complex

          

var PlusOperator = uc.GetItemOf("+");

while (PlusOperator.ItemHandle != null) {
   Console.WriteLine("Def: " + PlusOperator.Text() + "  Type: " + PlusOperator.GetDataType().Name());
   PlusOperator = PlusOperator.NextOverload();
}
// Output
// Def: Operator: 70 +{x}  Type: double
// Def: Operator: 50 {x} + {y}  Type: double
// Def: Operator: 50 {x As Int32} + {y As Int32} As Int32  Type: Int32
// Def: Operator: 50 {x As String} + {y As String} As String  Type: string
// Def: Operator: 50 {x} + {y As Complex} As Complex  Type: complex
// Def: Operator: 50 {x As Complex} + {y} As Complex  Type: complex
// Def: Operator: 50 {x As Complex} + {y As Complex} As Complex  Type: complex

          

//var PlusOperator = uc.GetItemOf('+');

      while PlusOperator.ItemHandle <>  0  do
begin
    
         WriteLn('Def: ' + PlusOperator.Text() + '  Type: ' + PlusOperator.GetDataType().Name());
         PlusOperator = PlusOperator.NextOverload();

End;
      // Output
// Def: Operator_: 70 +{x}  Type: double
// Def: Operator_: 50 {x} + {y}  Type: double
// Def: Operator_: 50 {x As Int32} + {y As Int32} As Int32  Type: Int32
// Def: Operator_: 50 {x As String} + {y As String} As String  Type: string
// Def: Operator_: 50 {x} + {y As Complex} As Complex  Type: complex
// Def: Operator_: 50 {x As Complex} + {y} As Complex  Type: complex
// Def: Operator_: 50 {x As Complex} + {y As Complex} As Complex  Type: complex

          

auto PlusOperator = uc.GetItemOf("+");

while (PlusOperator.ItemHandle != NULL) {
   cout << "Def: " << PlusOperator.Text() << "  Type: " << PlusOperator.GetDataType().Name() << endl;
   PlusOperator = PlusOperator.NextOverload();
}
// Output
// Def: Operator: 70 +{x}  Type: double
// Def: Operator: 50 {x} + {y}  Type: double
// Def: Operator: 50 {x As Int} + {y As Int} As Int  Type: int
// Def: Operator: 50 {x As String} + {y As String} As String  Type: string
// Def: Operator: 50 {x} + {y As Complex} As Complex  Type: complex
// Def: Operator: 50 {x As Complex} + {y} As Complex  Type: complex
// Def: Operator: 50 {x As Complex} + {y As Complex} As Complex  Type: complex

          

auto PlusOperator = uc.GetItemOf("+");

while (PlusOperator.ItemHandle != 0) {
   Console::WriteLine("Def: " + PlusOperator.Text() + "  Type: " + PlusOperator.GetDataType().Name());
   PlusOperator = PlusOperator.NextOverload();
}
// Output
// Def: Operator: 70 +{x}  Type: double
// Def: Operator: 50 {x} + {y}  Type: double
// Def: Operator: 50 {x As Int} + {y As Int} As Int  Type: int
// Def: Operator: 50 {x As String} + {y As String} As String  Type: string
// Def: Operator: 50 {x} + {y As Complex} As Complex  Type: complex
// Def: Operator: 50 {x As Complex} + {y} As Complex  Type: complex
// Def: Operator: 50 {x As Complex} + {y As Complex} As Complex  Type: complex

          
DLL import code
<DllImport(uCalcDLL, CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.Cdecl, EntryPoint:="NextOverload")> _

Private Function NextOverload__(ByVal ItemHandle As IntPtr) As IntPtr
End Function
            
[DllImport(uCalcDLL, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl, EntryPoint="NextOverload")]

protected static extern IntPtr NextOverload_(IntPtr ItemHandle);
            
{DLLImport}function NextOverload__(ItemHandle: System.Pointer): System.Pointer; cdecl; external uCalcDLL name 'NextOverload';

            
typedef uCalcPtr (* __NextOverload)(void *ItemHandle); 

            
[DllImport(uCalcLib, CharSet=CharSet::Ansi, CallingConvention=CallingConvention::Cdecl, EntryPoint = "NextOverload")]

static uCalcPtr NextOverload_(void *  ItemHandle);
            
Prev | Next