DefineOperatorMethod

Applies to:uCalc Transform
Class:uCalc
Defines an operator
Syntax
DefineOperator(Definition, iPrecedence, Grouping, FunctionAddress)
Parameters
Definition
String
Text containing operator to be defined
iPrecedence
Int32
Precedence level of the operator.
Grouping
(Default = GroupLeftToRight)
Operator associativity; arithmetic operators are typically grouped left-to-right; special operators, such as the equal sign, =, assignment operator are right-to-left
FunctionAddress
uCalcCallback
(Default = 0)
Address of callback function this operator is attached to
Returns
Type: Item
Defines an operator
Remarks
Many details for defining an operator are similar to those of defining a function. In additionn, all operators must be defined with a precedence level. You may use the Precedence function to obtain precedence levels of existing operators, and select a precedence level in comparison to those operators. By default operators are grouped left to right. But you may also set it to right to left. This means that when adjacent operators have the same precedence level, the operands on the right will be evaluated first.

DefineOperator("...") is the same as: Define("Operator: ...") More later+++

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

Private Function DefineOperator__(ByVal uCalcHandle As IntPtr,ByVal Definition As String , ByVal iPrecedence As Int32 , ByVal Grouping As GroupingEnum  , ByVal FunctionAddress As uCalcDelegate  ) As IntPtr
End Function
            
[DllImport(uCalcDLL, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl, EntryPoint="DefineOperator")]

protected static extern IntPtr DefineOperator_(IntPtr uCalcHandle, string Definition ,  Int32 iPrecedence , GroupingEnum Grouping  , uCalcDelegate FunctionAddress  );
            
{DLLImport}function DefineOperator__(uCalcHandle: System.Pointer;Definition: AnsiString ; iPrecedence: Int32 ; Grouping: GroupingEnum  ; FunctionAddress: System.Pointer): System.Pointer; cdecl; external uCalcDLL name 'DefineOperator';

            
typedef uCalcPtr (* __DefineOperator)(void *uCalcHandle, CONSTCHAR Definition  ,  int32_t iPrecedence ,  GroupingEnum Grouping  ,  UCCALLBACK FunctionAddress  ); 

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

static uCalcPtr DefineOperator_(void *  uCalcHandle, MARSHALSTR Definition  ,  Int32 iPrecedence ,  GroupingEnum Grouping  ,  UCCALLBACK FunctionAddress);
            
See also
Prev | Next