Inspection (Built-in Functions)
Expression Syntax: Exists(property)
Example:
Exists("_text_alignV&")
will only return True for Text, BoxText, Label and LineText items.
Returns:
True - The mnemonic exists on the current expression item.
False - The mnemonic does not exist on the current expression item.
Example of use of Exists():
Applying a filter to a new feature
When a new feature is drawn on an overlay its attributes are said to be null, (i.e. they do not exist until a value is assigned to them.)
When searching or applying a filter on an overlay, special measures need to be followed where a particular attribute is null.
Looking for an empty string (or a string with length 0) or even an integer or float of 0 does not return any results. This is because the property is not empty but is simply non-existent.
Use the Exists() function to check whether a property exists; this can be used within SIS expressions. Exists() will return a value of 0 (false) if a property does not exist and a value of -1(true) if it exists.
Consider the senario of a buildings overlay with an attribute called "building_type$".
There are four buildings (features) on the overlay, the information contained in "building_type$" is as follows:
ID Building_type
1 FLAT
2 HOUSE
3
4
Example Filter 1
To create a filter that displays all buildings that are houses:
building_type$ ="HOUSE"
Here only Feature 2 is displayed and not Features 1, 3 or 4.
Example Filter 2
To create a filter that displays all buildings where the building type attribute has not been set (i.e. where the building_type is null):
Exists("building_type$") = 0.
Here only Features 3 and 4 are displayed and not Features 1 or 2.
Example Filter 3
To create a filter that displays all buildings where the building type attribute has been set to anything OTHER than null (i.e. the building_type attribute contains a value):
Exists("building_type$") = -1
Here only Features 1 and 2 are displayed.
Example Filter 4
To create a filter that displays all buildings that are not flats:
building_type$ <>"FLAT"
Here Feature 2 will be displayed and not features 1, 3 and 4.
Example Filter 5
To create a filter that displays all buildings that are not flats and all features that have null for building_type$:
building_type$ <>"FLAT" or Exists("building_type$") = 0
Here Features 2, 3 and 4 are displayed and not Feature 1.
Expression Syntax: "expression" Is Not Null
Example:
startdate@ Is Not Null
returns -1 if startdate@ exists, 0 if startdate@ does not exist.
Expression Syntax: "expression" Is Null
Example:
Value@ Is Null
returns 0 if startdate@ exists, -1 if startdate@ does not exist.