Jul 22, 2015

Linx 4 vs Linx 5: Part 3 - Expressions

An Expression is a combination of values, operators and functions that are evaluated to produce a single value. Expressions in Linx use C# syntax. Here are some examples

  • 5 evaluates to 5
  • 5 + 2 evaluates to 7
  • "abc" evaluates to "abc"
  • "abc" + "def" evaluates to "abcdef"
  • 5 == 5 evaluates to true
  • 5 != 5 evaluates to false

Any Property in Linx that does not need its value resolved at design-time can have an Expression as its value. Expressions are resolved at run-time. Expressions are denoted by "=" before the Expression.



Expression Editor

The Expression Editor makes it easier to create and edit complex expressions. It includes syntax highlighting, intellisense, code completion and built-in help.


This is what it looks like



Variables

a Variable is a value that is available at run-time. Variables are produced by

  • Functions e.g. TextFileRead.
  • Types e.g. String.
  • CustomType e.g. Person with properties Name, Surname, Age.
  • System e.g. CurrentDateTime, NewLine (CrLf) and Null.



Expression Editor System Functions

System Functions can be performed on specific types of data. They are typically used to do formatting, conversion or extraction. Examples are

  • String - Contains, ExtractString, FormatWith, Trim.
  • DateTime - AddDays, ExtractDay, ToString.


String Functions



DateTime Functions




Next

The next post will discuss Types, also brand new to Linx 5.


1 comment: