Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
TriadicExpression 1.0 - Evaluate expressions
Author:
Paul Arminson
Submitted:
4/30/2014
Version:
VB 2013
Compatibility:
VB 2010, VB 2012, VB 2013
Category:
Miscellaneous
Downloads:
1573
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[1] .ToString __)) $arraypaths := (_System.IO.Directory .GetDirectories 'C:\Products') $result := (_ConsoleApplication1.Class1 .MySharedFunction ('hello' , 123))
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement