Home Evaluation Summary for programmers Product limitations Goals of Axisbase Quick start Installation Using the launchpad and opening databases Connecting to a sample database Using building blocks Planning Define the purpose Define the requirements Borrow existing work Determine the architecture Design the data model Design the process model Deploy and maintain the product
building blocksPerforming a mailmerge Bulk e-mailing
ProgrammingSingle-threaded progress indicator in c#
Database menu itemsImport XML Save Copy As Integrity Check Change Password
Database Properties windowOpening the database properties window Record types tab Display types tab Roles and Users tabs Sidebar tab Database ID/Links tab Counters tab
Building blocksBuilding blocks window Editing grids and cells Hyperlinks and nesting Data Subset window Data Outsource window List window Window window Report window Bulk Operation window Label Printer window Choosing a data source
Special topicsExpression syntax Browse records Storing building blocks within other building blocks Programming Using custom code in building blocks Using Axisbase as an embedded database Axis1.Util namespace reference Axis1.Data namespace reference (Fishnets) Axis1.Data namespace reference (other) Axis1.Forms namespace reference
Axisbase uses expressions in several places:
Expression basics and examples
To refer to a column in a data table, use the # character followed by the complete column name, which is usually the Axis ID, record type name, and property name separated by dots. Calculated columns have whatever name you assign and don't follow this pattern. Examples:
To refer to a parameter, use the @ character. Example:
You can use basic arithmetic:
#SATURN.employee.salary * 1.05
For a filter, you can compare column values with literal values, and use && for "and" and || for "or":
#SATURN.employee.salary >= 20000 && #SATURN.employee.dept = 2
You can combine text in quotes with other things:
"Showing all customers whose name starts with " @namestartswith
To change the default formatting for numbers and dates, add [format-codes] to the expression. Example:
This shows the year and month of the birthdate. You can combine formats with other operators:
"born in (#SATURN.person.birthdate [M]) " of the year " (#SATURN.person.birthdate [yyyy])
Here are the format characters that can be applied to numeric data types:
Here are the format characters that can be applied to datetime data:
Note to programmers: The characters within the square brackets are used in the .NET ToString() call. To find a complete list of format strings, see http://msdn2.microsoft.com/en-us/library/427bttx3.aspx, or search msdn2.microsoft.com for "format strings".
Literals are constant values that are not variables. Axisbase understands these literal types:
Identifiers must start with a prefix character: # for column names, @ for parameters, or $ for some special values.
Identifiers may contain letters, digits, and the three symbols . _ ^
The available special values are:
To concatenate two values as strings, separate them with a space.
If a format string is followed by another format string or a string value, they are combined into a longer format string. For example, if the value of the parameter @fmt is "dd", then the expression $now ([M-] @fmt) would be the same as $now [M-dd].
Operators to compare equality are: =, <>, >, >=, <, <=
The "and" operator is &&. The "or" operator is ||.
Arithmetic operators are +, -, *, /, %. (% calculates the remainder of a division; for example 10 % 3 = 1.)
The following built in functions are used without a prefix character.
pattern matching & full text searches
There are two functions that allow you to do full-text searches - that is, searching for words anywhere in a string. These are match and matchf. (Note that these functions are only available in a complex filter; the fast filter can only compare the beginning of a string, not do a full text search.)
Match is used with wildcard characters to give you control over exactly how a single term is matched. An example would be
The example expression would return true if the person's name contained "smith" anywhere in it. However, this would not match "Smith" with a capital S. For that you would need the more complex:
The sequence (?i: means "ignore upper/lower case", and requires a closing parenthesis. In practice you would allow the user to enter a search term as a parameter, and combine that with the "ignore case" construct, like this:
match(#SATURN.person.name, "(?i:" @namelike ")")
The example immediately above is similar to the SQL "LIKE" operator. But it is a lot more powerful since it allows you to use all regular expression syntax provided by Microsoft .NET. Learn all about it here: http://http://msdn2.microsoft.com/en-us/library/hs600312.aspx
The other function, matchf, is a "fuzzy" search, a very basic version of what you would expect with a search engine like Google. Here is an example:
matchf(#SATURN.product.notes, "contrast paint thinner") > 0
Expressions in the c# language can be embedded in Axisbase expressions. Use the delimiters <% and %> to mark c# expressions. To obtain the value of columns and parameters within c# expressions, you have to embed Axisbase expressions within c# expressions (which are embedded in Axisbase expressions!) Use methods stringex, intex, doubleex, decimalex, dateex, datetimeex, and boolex to evaluate Axisbase expressions from within c# expressions. intex returns the type Int64, while the other methods return types consistent with their names.