Property Expression Syntax

As well as using single properties in Schema and Filter objects, several properties can be combined into a mathematical expression. SIS will calculate the value for the expression in the same way as many computer programming languages, such as Visual Basic.

SIS allows you to cascade expressions where multiple operators are used in a single expression. A string expression for example can be used in combination with a comparison operator like Iif.

iif(Left(test$,3)="abc","String begins with ABC","String does not begin with ABC")

If the test$ property is “ABCD” the true statement will be returned from the expression.

If the test$ string property is “BCDA” the false statement will be returned from the expression.

The expressions can use mathematical operators, functions, and spatial searches.

Note: A number of functions are available with or without a W Suffix. In practical use on words and numbers in languages such as English there will be no difference between text functions with or without the W Suffix, other than performance, where the W version is faster. See explanation below.

If using double byte characters such as Kanji in places such as Japan, the difference will be seen. In these instances it is appropriate to use the expression without the W suffix.

Text functions with the W suffix use UTF-16 encoded strings (http://en.wikipedia.org/wiki/Utf-16) and all offsets/indices as parameters/return values are interpreted as word-indices of UTF-16 code words. (1 word = 2 bytes.) Text functions without the W suffix use ANSI encoded strings (so they require string conversions UTF-16 to ANSI and perhaps ANSI to UTF-16 too and are therefore slower than their W counterparts) and any indices that are byte-indices into the ANSI multi-byte representation of the strings.

Formatting Elements

There are a number properties in SIS that can be used to format attributes.

These properties are:

Title

 

This property changes a string to title case, i.e. makes the first letter of each word uppercase.

Example: Title(Street$)

Upper

 

Converts a string to uppercase characters.

Example: Upper(postcode$)

Lower

 

Converts a string to lowercase characters.

Example: Lower(postcode$)

Local

 

Gets the local representation of a number as a string, i.e. adds a separator for each 1000

Examples: Local(Value#) or to add a £ before the value “£”+Local(Value#)

Sentence

 

Changes a string to sentence case.

Example: Sentence(Details$)

Parse Date

 

Formats any Microsoft date format into one format.

Example: ParseDate(Date$)

The first table below shows the original format of the attributes.

The second table below shows the effects of adding the following formatting properties:

Title prefixed to Street$ / Town$ Expression field becomes Title(Street$) / Title(Town$)
Upper prefixed to postcode$ Expression field becomes Upper(postcode$)
“£”+Local prefixed to Value# Expression field becomes “£”+Local(Value#)
Sentence prefixed to Details$ Expression field becomes Sentence(Details$)
ParseDate prefixed to Date$ Expression field becomes ParseDate(Date$)

Expression Elements

Note: Expressions passed to other expressions must be enclosed in curly braces.

For example the expression income&/1000 when passed to CalcItems would be:

CalcItems("Addresses",{income&/1000},OP_Sum,ST_Within,ST_Geometry)

A further example of this nesting of expressions is shown in the CalcItems description in Spatial section of this topic.

Built-in properties

Geometry

Style

Text

Functions > Built-in functions

Date

Inspection

Maths

Program Flow

Scope

Spatial

String

Constants

Operators

Arithmetic

Comparison

Logical


Top of page

Send comments on this topic.

Click to return to www.cadcorp.com

© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).