Practical: Iterates through all overloads of the '+' operator and displays their unique definition text.
ID: 675
See: Text = [string]
using uCalcSoftware;
var uc = new uCalc();
var PlusOperator = uc.ItemOf("+");
do {
Console.WriteLine($"Def: {PlusOperator.Text} -- Type: {PlusOperator.DataType.Name}");
PlusOperator = PlusOperator.NextOverload();
} while (PlusOperator.NotEmpty());
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 As Complex} + {y As Complex} As Complex -- Type: complex
Def: Operator: 50 {ByHandle x As AnyType Ptr} + {y As Int} As SameTypeAs:0 Ptr -- Type: sametypeas:ptr
Def: Operator: 50 {ByHandle x As AnyType} + {ByHandle y As String} As String -- Type: string
Def: Operator: 50 {ByHandle x As String} + {ByHandle y As AnyType} As String -- Type: string using uCalcSoftware; var uc = new uCalc(); var PlusOperator = uc.ItemOf("+"); do { Console.WriteLine($"Def: {PlusOperator.Text} -- Type: {PlusOperator.DataType.Name}"); PlusOperator = PlusOperator.NextOverload(); } while (PlusOperator.NotEmpty());
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto PlusOperator = uc.ItemOf("+");
do {
cout << "Def: " << PlusOperator.Text() << " -- Type: " << PlusOperator.DataType().Name() << endl;
PlusOperator = PlusOperator.NextOverload();
} while (PlusOperator.NotEmpty());
}
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 As Complex} + {y As Complex} As Complex -- Type: complex
Def: Operator: 50 {ByHandle x As AnyType Ptr} + {y As Int} As SameTypeAs:0 Ptr -- Type: sametypeas:ptr
Def: Operator: 50 {ByHandle x As AnyType} + {ByHandle y As String} As String -- Type: string
Def: Operator: 50 {ByHandle x As String} + {ByHandle y As AnyType} As String -- Type: string #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto PlusOperator = uc.ItemOf("+"); do { cout << "Def: " << PlusOperator.Text() << " -- Type: " << PlusOperator.DataType().Name() << endl; PlusOperator = PlusOperator.NextOverload(); } while (PlusOperator.NotEmpty()); }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim PlusOperator = uc.ItemOf("+")
Do
Console.WriteLine($"Def: {PlusOperator.Text} -- Type: {PlusOperator.DataType.Name}")
PlusOperator = PlusOperator.NextOverload()
Loop While PlusOperator.NotEmpty()
End Sub
End Module
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 As Complex} + {y As Complex} As Complex -- Type: complex
Def: Operator: 50 {ByHandle x As AnyType Ptr} + {y As Int} As SameTypeAs:0 Ptr -- Type: sametypeas:ptr
Def: Operator: 50 {ByHandle x As AnyType} + {ByHandle y As String} As String -- Type: string
Def: Operator: 50 {ByHandle x As String} + {ByHandle y As AnyType} As String -- Type: string Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim PlusOperator = uc.ItemOf("+") Do Console.WriteLine($"Def: {PlusOperator.Text} -- Type: {PlusOperator.DataType.Name}") PlusOperator = PlusOperator.NextOverload() Loop While PlusOperator.NotEmpty() End Sub End Module