3sgrMath - 3sgr/DatacapOS GitHub Wiki

3sgrMath

Mathematical operations for everyone!

Abstract

This library is designed to provide rich support for complex computations and logical operations.

Structure

It consists of several independent modules:

Custom Actions

This module has consists of two parts:

  • Code required by Datacap to comply with Custom Action format.At the moment the only entry point function available for execution in rules is ProcessFormula(<formula>), where <formula> is an expression that is very similar to Algebraic equation in a form of A = B + C with a few exceptions.
  • Implementation of all "Datacap-specific" delegates. Formula may contain specific keywords that can be also incorporated in the formula. Consider the following formula: @B.TotalPages=Count("//B/D/P") Read more here

Formula Processor

This module is an abstract formula processor. It parses the right side of equation (that might be just a single function) in attempt to resolve it to a single value. This value will always be returned as String (due to the nature of software), but can be one of the data types currently supported.

Functions

This module consists of delegate functions that are combined into a dictionary (where key is a unique string identifier) that is passed to the Formula Processor. All of the functions declared (and implemented) here are irrelevant to Datacap objects or data. Consider the following: If Formula Processor encounters a keyword (aka function call) it will refer to the list of functions passed along to the Formula Processor from the Functions module and Custom Actions module to search for the implementation of that particular function, unless parameter is the lowest level (either a value or a reference - aka smart parameter). If the parameter is another functions (e.g. sin(cos(1))) Formula Processor will work on computing the inner value first.

Samples

Please follow this link for samples.

⚠️ **GitHub.com Fallback** ⚠️