Any of the Words
Link to us
TriadicExpression 1.0 - Evaluate expressions
VB 2010, VB 2012, VB 2013
This tool implements a triadic expression, which has 3 parts: operand operator operand An operand can itself be a triadic expression in parenthesis, so it is possible to have complex expressions. Several types of expression can be evaluated: arithmetic, comparison, boolean, function calls, etc... The operands can be literal numbers, Strings, or variable names. The variables can contain any kind of VB.NET object. The variable syntax supports the indexing of arrays or Lists, as well as Dictionary keys. Operators can be arithmetic and comparison symbols, but also VB.NET method names (Sub, Function, constructor, Property). An expression string typed dynamically at run time can call almost any VB.NET method, whether it's a Microsoft library function or not, because VB.NET reflection is used. In a way, a TriadicExpression could be seen as a little piece of .NET programming that can be executed without compilation. This is suited to scripting languages, such as VbTemplateScript, which generates HTML or SQL text based on a template script, using TriadicExpression as the expression evaluator. Here are a few examples of triadic expressions: 78.99 + (1234 * 0.75) (_System.Math .Sqrt 256R) * 3.1416R ($birthdate > '1999-12-31') OrElse (_ Not ($age > 65)) 'Harry has a hat' .LastIndexOf ('ha' , (14 , 9)) $nameage := ($dictperson.name & ($ages .ToString __)) $arraypaths := (_System.IO.Directory .GetDirectories 'C:\Products') $result := (_ConsoleApplication1.Class1 .MySharedFunction ('hello' , 123))
© 2019 A1VBCode. All rights reserved.