Evaluating expressions from strings in VBA

This page summarizes the projects mentioned and recommended in the original post on /r/vba

Our great sponsors
  • InfluxDB - Access the most powerful time series database as a service
  • SonarQube - Static code analysis for 29 languages.
  • SaaSHub - Software Alternatives and Reviews
  • stdVBA

    VBA Standard Library - A Collection of libraries to form a common standard layer for modern VBA applications.

    At that point, I decided to try the fabulous stdLambda tool, developed by u/sancarn. I found that stdLambda correctly evaluated all the corner cases that made Volpi's class fail. This fact excited me, so I decided to measure the time it took to evaluate an expression with variables, noticing that the u/sancarn library was quite efficient. At that point, I started to measure the performance by evaluating functions like sin, cos, tan, abs, the results seemed strange to me when I noticed that the performance was almost 50 times lower when compared to the results obtained when measuring the performance by evaluating expressions without calls to built-in functions.

  • VBA-CSV-interface

    The power you need to cleanse, filter, sort, reshape, manage and analyze data from CSV files.

    In spite of what I discovered, I was convinced that I could incorporate the referred library to CSV Interface, so I dedicated myself to study the methodology with which variables are handled in stdLambda. I found it difficult to understand why the variables must be passed in terms of a pre-established order ($1 refers to the first value passed as parameter of the evaluate function, $4 the fourth... and so on). Thus, the user is forced to write the expressions taking into account the order in which the values will be passed.

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • VBA-Expressions

    A powerful string expression evaluator for VBA, which puts more than 60 mathematical, financial, date-time, logic and text manipulation functions at the user's fingertips.

    After a long search for something similar to the above, I decided to experiment and test the veracity of a warning that read: "... rather, it evaluates the infix expression directly. This approach is slightly more complicated than the traditional one". Then, I chose to develop an evaluator with its own grammar and a different approach to handle mathematical expressions. The solution I came up with is so called VBA Expressions. With VBA Expressions we can evaluate a variety of mathematical expressions, being able to work with arrays defined by text strings as in Java. A notorious feature is the ability to work with variables (Pi.e * 5.2Pie.1 + 3.1Pie), constants (3pi+ln(2e)), floating point numbers ((1.434E3+1000)*2/3.235E-5) and Boolean values (x>0 & Sqr(x-Ln(2))>=3 | tan(x)<0).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts