uCalc API Version: 2.1.3-preview.2 Released: 6/17/2026

Warning

uCalc API Preview Release Notice:The documentation describes the intended behavior of the API. The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.

Properties

Method

Product: 

Fast Math Parser

Class: 

uCalcBase

Creates a bitmask for querying items by their properties, such as function, operator, or variable.

Syntax

Properties(ItemIs, ItemIs, ItemIs, ItemIs)

Parameters

property1
ItemIs
The first property to include in the filter.
property2
ItemIs
(Default = ItemIs::SelectAny)
A second, optional property to combine.
property3
ItemIs
(Default = ItemIs::SelectAny)
A third, optional property to combine.
property4
ItemIs
(Default = ItemIs::SelectAny)
A fourth, optional property to combine.

Return

int64

A 64-bit integer bitmask representing the combined properties, for use with the ItemOf method.

Remarks

⚙️ Core Concept: Building a Query Filter

This static helper function is the primary tool for building complex, multi-property queries with the ItemOf method. It takes one or more property flags from the ItemIs enum and combines them into a single 64-bit integer bitmask that ItemOf can use to filter and retrieve items.

It allows you to find items that match a specific set of criteria, such as "find all items that are either a prefix or a postfix operator."

🧠 Selector Logic: SelectAny vs. SelectAll

By default, Properties creates a filter that matches items with any of the specified properties (a logical OR). You can change this behavior by including a selector flag as the first argument.

  • ItemIs::SelectAny (Default)The returned item must match at least one of the provided properties. This is the default behavior and does not need to be specified explicitly if it's the desired logic.

  • ItemIs::SelectAllThe returned item must match all of the provided properties (a logical AND). This is used for creating highly specific filters.

🔧 Technical Details & Language Quirks

  • Bitmask Conversion: Internally, members of the ItemIs enum are sequential integers (0, 1, 2, ...). The ItemOf method, however, expects a bitmask where properties correspond to powers of two (1, 2, 4, ...). This function handles that conversion automatically.

  • VB.NET Requirement: In C# and C++, you can pass a single ItemIs member directly to ItemOf thanks to method overloading. However, because VB.NET does not distinguish enums from integers in the same way, you must use this Properties function even when filtering by a single property.

⚖️ Comparative Analysis

  • vs. LINQ (C#): In LINQ, you would build a similar query using lambda expressions and logical operators, which is often more readable for native .NET development:

    var operators = items.Where(i => i.IsPrefix || i.IsPostfix);

    uCalc's Properties method uses a classic bitmasking approach common in C-style APIs. Its main advantage is being completely language-agnostic, providing the exact same query mechanism for C#, C++, and VB.NET developers.

  • vs. SQL: The SelectAny and SelectAll logic is analogous to using OR and AND in a SQL WHERE clause to filter results from a database table.

Examples

ItemOf based on properties
				
					using uCalcSoftware;

var uc = new uCalc();
var Item = new uCalc.Item();
var x = 0;

// Lists the first few funcions defined in uCalc
// For the full list, loop until Item.IsEmpty() or while Item.NotEmpty()
for ( x = 0; x <= 15; x++) {
   Item = uc.ItemOf(ItemIs.Function, x);
   Console.WriteLine(Item.Name);
}
Console.WriteLine("---");

// List only Prefix and Postfix (operators)
x = 0;
do {
   Item = uc.ItemOf(uCalc.Properties(ItemIs.Prefix, ItemIs.Postfix), x);
   x = x + 1;
   Console.WriteLine(Item.Name);
} while (Item.NotEmpty());
				
			
abs
acos
acosh
addptr
addressof
anytype
append
append_copy
arg
argcount
asc
asin
asinh
atan
atan2
atanh
---
!
+
-
not
~
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uCalc::Item Item;
   auto x = 0;

   // Lists the first few funcions defined in uCalc
   // For the full list, loop until Item.IsEmpty() or while Item.NotEmpty()
   for ( x = 0; x <= 15; x++) {
      Item = uc.ItemOf(ItemIs::Function, x);
      cout << Item.Name() << endl;
   }
   cout << "---" << endl;

   // List only Prefix and Postfix (operators)
   x = 0;
   do {
      Item = uc.ItemOf(uCalc::Properties(ItemIs::Prefix, ItemIs::Postfix), x);
      x = x + 1;
      cout << Item.Name() << endl;
   } while (Item.NotEmpty());
}
				
			
abs
acos
acosh
addptr
addressof
anytype
append
append_copy
arg
argcount
asc
asin
asinh
atan
atan2
atanh
---
!
+
-
not
~
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim Item As New uCalc.Item()
      Dim x = 0
      
      '// Lists the first few funcions defined in uCalc
      '// For the full list, loop until Item.IsEmpty() or while Item.NotEmpty()
      For x  = 0 To 15
         Item = uc.ItemOf(ItemIs.Function , x)
            Console.WriteLine(Item.Name)
         Next
         Console.WriteLine("---")
         
         '// List only Prefix and Postfix (operators)
         x = 0
         Do
            Item = uc.ItemOf(uCalc.Properties(ItemIs.Prefix, ItemIs.Postfix), x)
            x = x + 1
            Console.WriteLine(Item.Name)
         Loop While Item.NotEmpty()
      End Sub
   End Module
				
			
abs
acos
acosh
addptr
addressof
anytype
append
append_copy
arg
argcount
asc
asin
asinh
atan
atan2
atanh
---
!
+
-
not
~
ItemOf selection between infix version of - (minus) operator and unary prefix version with Properties
				
					using uCalcSoftware;

var uc = new uCalc();

// Returns number of operands for the given operators
Console.WriteLine(uc.ItemOf("-", uCalc.Properties(ItemIs.Infix)).Count);
Console.WriteLine(uc.ItemOf("-", uCalc.Properties(ItemIs.Prefix)).Count);

// You can pass one property directly in C++ and C#, but not VB
Console.WriteLine(uc.ItemOf("-", ItemIs.Infix).Count);
Console.WriteLine(uc.ItemOf("-", ItemIs.Prefix).Count);

				
			
2
1
2
1
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;

   // Returns number of operands for the given operators
   cout << uc.ItemOf("-", uCalc::Properties(ItemIs::Infix)).Count() << endl;
   cout << uc.ItemOf("-", uCalc::Properties(ItemIs::Prefix)).Count() << endl;

   // You can pass one property directly in C++ and C#, but not VB
   cout << uc.ItemOf("-", ItemIs::Infix).Count() << endl;
   cout << uc.ItemOf("-", ItemIs::Prefix).Count() << endl;

}
				
			
2
1
2
1
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      
      '// Returns number of operands for the given operators
      Console.WriteLine(uc.ItemOf("-", uCalc.Properties(ItemIs.Infix)).Count)
      Console.WriteLine(uc.ItemOf("-", uCalc.Properties(ItemIs.Prefix)).Count)
      
      
      
      '// You can pass one property directly in C++ and C#, but not VB
      Console.WriteLine(2) '// C++ and C# only: uc.ItemOf("-", ItemIs::Infix).@Count();
      Console.WriteLine(1) '// C++ and C# only: uc.ItemOf("-", ItemIs::Prefix).@Count();
   End Sub
End Module
				
			
2
1
2
1