1.2. Use Expression Functions Window

The following expression building operations are available in the Expression Functions window.

  • Alarm
  • Arithmetic
  • Bitwise
  • General
  • Historian
  • Logical
  • Relational
  • Scientific
  • Shape Attribute
  • String
    For all functions,
    • int represents the int64 data type and real represents the double data type.
    • for regions where the decimal separator is a comma (,), include a space after the parameter and before the comma. For example:
      FormatReal(123,456,1,9,1,0,0) returns an error
      FormatReal(123,456 ,1 ,9 ,1 ,0 ,0) returns 0000123.5
    • you can enter variables, points, or expressions as the input parameters

Alarm

Item Value Result
A1 WARNING Returns TRUE if the point is in a Warning High or Warning Low state.
Format A1(<point id>)
A2 ALARM Returns TRUE if the point is in an Alarm High or Alarm Low state.
Format A2(<point id>)
AH1 WARNING_HIGH Returns TRUE if the point is in a Warning High state.
Format AH1(<point id>)
AH2 ALARM_HIGH Returns TRUE if the point is in an Alarm High state.
Format AH2(<point id>)
AL Returns TRUE if the point is in any Alarm or Warning state.
Format AL(<point id>)
AL1 WARNING_LOW Returns TRUE if the point is in a Warning Low state.
Format AL1(<point id>)
AL2 ALARM_LOW Returns TRUE if the point is in an Alarm Low state.
Format AL2(<point id>)
ANA ALARM_NOT_ACKED Returns

TRUE if the point is in alarm and the alarm has not been acknowledged.

Note: The ANA behavior was changed in CIMPLICITY V.6.1. Prior to V.6.1 it behaved as NACK.

The global parameter PTEXP_ANA_EQ_NACK_AND_AL is available to revert ANA behavior to pre-version 6.

Format

ANA(<point id>)

Important: ANA is not supported for Enterprise points.

NACK Returns TRUE if the alarm has not been acknowledged, whether or not the point is in an alarm state.
Format NACK (<point id>)

Arithmetic

Operation Result
- Returns Difference between X and Y.
Format <expr1>-<expr2>
* Returns Product of X and Y.
Format <expr1>*<expr2>
/ Returns Quotient of X and Y.
Format <expr1>/<expr2>

Note: The result of dividing two integers in an expression will be an integer. If you want the result to be a floating point, multiply the numerator by 1.0 before dividing.

Example

POINTA is set to 6.

POINTB is set to 4.

Results:

POINTA/POINTB = 1

(POINTA*1.0)/POINTB = 1.5

+ Returns Sum of X and Y.
Format <expr1>+<expr2>
ABS Returns Absolute value of X.
Format

ABS(expr)

Example

ABS(-2.6) returns 2.6

CEIL Returns Nearest integer greater than or equal to X.
Format

CEIL (expr)

Example

CEIL(2.3) returns 3

CEIL(-2.3) returns -2

FLR Returns Nearest integer less than or equal to X.
Format

FLR(expr)

Examples

FLR(2.6) returns 2

FLR(-2.6) returns -3

MAX Returns Maximum comparing X and Y.
Format

<expr1> MAX <expr2>

Example

3 MAX 4 returns 4

MIN Returns Minimum comparing X and Y.
Format

<expr1> MIN <expr2>

Example

3MIN4 returns 3.

MOD Returns Value of X modulo Y.
Format

<expr1> MOD <expr2>

Example

9 MOD 8 returns 1

RND Returns Integer nearest to X.
Format

RND(expr)

Example

RND(2.6) returns 3

RND(-2.6) returns -3

SQR Returns Square root of X.
Format SQR(<expr>)
TRUNC Returns Value of X with the fractional part removed; the result is its integer value.
Format

TRUNC(expr)

Examples

TRUNC(2.6) returns 2

TRUNC(-2.6) returns -2

VAL Returns

Numeric value of a text string.

Note: VAL converts a variable that consists of numbers in text string format to a numeric format that can be included in calculations.

Format VAL(expr)

Bitwise

Operation Result
BAND Performs Bitwise AND of X and Y.
Format <expr1>AND<expr2>
BOR Performs Bitwise OR of X and Y.
Format <expr1>OR<expr2>
BNOT Performs Bitwise NOT of X and Y.
Format NOT<expr>
BXOR Performs Bitwise XOR of X and Y.
Format <expr1>XOR<expr2>
SHL Returns Value of X shifted left by Y bits.
Format <expr1>SHL<expr2> Example 2 SHL 1 returns  4
Note: When SHL goes out of range the: Point becomes unavailable. Point Control Pane is starred. Core status log notes that it is unavailable.
SHR Returns  Value of X shifted right by Y bits.
Format <expr1>SHR<expr2> Example 2 SHR 1 returns 1
Note: When SHR goes out of range the: Point becomes unavailable. Point Control Pane is starred. Core status log notes that it is unavailable.

General

Operation Result
?:IF/THEN/ELSE Returns The value of <True_Expr> if the value of <Cond_Expr> is true. Otherwise, it returns the value of <False_Expr>. The ternary operator (?:) is shorthand for the IF/THEN/ELSE operator.
Name Type The Input is the:
Inputs <Cond_Expr> Boolean Expression to be tested.
<True_Expr> Any Value to return if <Cond_Expr> is true.
<False_Expr> Any Value to return if <Cond_Expr> is false.
Format

IF <Cond_Expr> THEN <True_Expr> ELSE <False_Expr>

or

<Cond_Expr> ? <True_Expr> : <False_Expr>
CalcSpan Returns An unsigned 64-bit integer containing a duration of time (in decimicroseconds).
Format CalcSpan[<days>,<hours>,<minutes>,<seconds>,<fracsec>]
CalcStamp Returns An unsigned 64-bit integer containing a time stamp (in decimicroseconds).
Format CalcStamp[<year>,<month>,<day>,<hour>,<minute>,<second>,<fracsec>]
EU_CONV Returns Converts the default raw value of a device point ID in an expression for virtual points to the engineering units value.
Format EU_CONV(Point_ID)
GetQualityBit Gets

Quality Bit for the specified bit index.

Note: GetQualityBit retrieves the quality of the specified expression for a given bit number.

The bit number ranges from 0 to 31.

Format GetQualityBit(<expression>,<bit index>)
GetWindowsSessionID Returns The Windows Session ID of a CimView instance based on the type of session it is running.
Format GetWindowsSessionID()
IsAvailable Returns If expression is available.
Format IsAvailable(<expression>)
IsConfigured Returns True if point is configured.
Format IsConfigured(P)
QL Retrieves The quality (64-bit integer) returned for the wrapped expression.
Format QL[<expr>]
TS Retrieves Time stamp returned for the wrapped expression.
Format TS(<expr>)
Note: When IsConfigured function is used in an expression, the expression is considered as valid if the syntax of the expression is correct, irrespective of whether the points included in the Isconfigured function are configured or not. A valid expression is displayed with a green check mark in Expression View.

If a point that is not configured is used in an expression, it is a valid expression only if the point has already been included in Isconfigured function.

Example: isConfigured(ABadPoint)?ABadPoint:10

The above expression is valid because ABadPoint has already been used in the Isconfigured function.

Example: isConfigured(ABadPoint)?ABadPoint2:10

The above expression is not valid because ABadPoint2 is not configured and it not been included in the Isconfigured function.

Historian

Historian data calls and special functions that retrieve data can be used inside standard expressions.

If you are using the local Historian server, you can enter \\\ instead of the server name.

However, the Historian API only connects to the default server if it is on the local machine. The server name must be entered if the default server is not the local machine.

Example:

\\\PROFCIMP.LEVELTSOUTH

where:

\\\ indicates the local Historian server, which would be entered as \\<local server>\ if the abbreviation was not used.

ProfCIMP.LEVELTSOUTH is a Historian tag that will be included in the expression.

When or when not to use double-quotes in a Historian expression is as follows.

Use double-quotes when Historian tags are used in the expression.

Note: Because Historian tags will be used most frequently, CIMPLICITY automatically includes double-quotes when you select a Historian function in the Expression Editor.

Do not use double-quotes:

  • If you do not use a Historical tag ID, but use either a point ID or GetHistTagID(P).
    Note: You must remove the double quotes that are added automatically.
  • A global parameter, EXPRESSION_TRACE_LEVEL, is available to trace Historian related problems with connections and expressions
Operation Result
GetHistTagID Returns A string that may be used to look up a Historian tag from the inputted point symbol.
Format GetHistTagID(P) Where P is a CIMPLICITY point ID that has a corresponding tag ID in Historian.
HistAv Retrieves Average numeric value of a Historian tab at or before the specified timestamp over the specified previous span.
Format HistAv("\\<Historian connection ID>\<TagID>",<Timestamp>,<Span>)
HistCom Retrieves Comment (String) of a Historian tag.
Format HistCom("\\<Historian connection ID>\<TagID>",<Timestamp>)
HistCount Retrieves Count value of a Historian tag at or before the specified timestamp over the specified previous span.
Format HistCount("\\<Historian connection ID>\<TagID>",<Timestamp>,<Span>)
HistDesc Retrieves Description (string) of a Historian tag.
Format HistDesc("\\<Historian connection ID>\<TagID>",<Timestamp>)
HistEU Retrieves Engineering Unit (string) of a Historian tag.
Format HistEU("\\<Historian connection ID>\<TagID>",<Timestamp>)
HistHightEU Retrieves High engineering Unit (string) of a Historian tag.
Format HistHightEU("\\<Historian connection ID>\<TagID>",<Timestamp>)
HistI Retrieves 64-bit integer value of a Historian tag at or before the specified timestamp.
Format HistI("\\<Historian connection ID>\<TagID>",<Timestamp>)
HistLowEU Retrieves Low engineering Unit (string) of a Historian tag.
Format HistLowEU("\\<Historian connection ID>\<TagID>",<Timestamp>)
HistMax Retrieves Max numeric value of a Historian tag at or before the specified timestamp over the specified previous span.
Format HistMax("\\<Historian connection ID>\<TagID>",<Timestamp>,<Span>)
HistMin Retrieves Min numeric value of a Historian tag at or before the specified timestamp over the specified previous span.
Format HistMin("\\<Historian connection ID>\<TagID>",<Timestamp>,<Span>)
HistN Retrieves Raw numeric value (double float) of a Historian tag at or before the specified timestamp.
Important: Historian batches and writes values.  HISTN reports the value whenever it sees it. Due to the batch writing, an update may not be there at the time of the request from the HISTN function. Example $LOCAL.DATETIME)INTERVAL is set to 10 causing $LOCAL.DATETIME_VARUPDATE to update 10 times per second. The HistN expression updates when it sees a reported value from Historian, which is one time every two seconds. Several $LOCAL.DATETIME_VARUPDATE updates can be missed. You can avoid seeing this behavior if you change the request by deferring for a specified amount of time, e.g. 5 seconds. Example HistN("\\\Simulation00001", $LOCAL.DATETIME_VARUPDATE - CalcSpan(0,0,0,5,0))
Format HistN("\\<Historian connection ID>\<TagID>",<Timestamp>)
HistRawAv Retrieves Raw average numeric value of a Historian tag at or before the specified timestamp over the specified previous span.
Format HistRawAv("\\<Historian connection ID>\<TagID>",<Timestamp>,<Span>)
HistRawStandDev Retrieves Standard deviation raw  numeric value of a Historian tag at or before the specified timestamp over the specified previous span.
Format HistRawStandDev("\\<Historian connection ID>\<TagID>",<Timestamp>,<Span>)
HistRawTot Retrieves Total numeric value of a Historian tag at or before the specified timestamp over the specified previous span.
Format HistRawTot("\\<Historian connection ID>\<TagID>",<Timestamp>,<Span>)
HistS Retrieves String value of a Historian tag at or before the specified timestamp.
Format HistS("\\<Historian connection ID>\<TagID>",<Timestamp>)
HistStandDev Retrieves Standard deviation numeric value of a Historian tag at or before the specified timestamp over the specified previous span.
Format HistStandDev("\\<Historian connection ID>\<TagID>",<Timestamp>,<Span>)
HistTot Retrieves Raw total numeric value of a Historian tag at or before the specified timestamp over the specified previous span.
Format HistTot("\\<Historian connection ID>\<TagID>",<Timestamp>,<Span>)

Logical

You can use Boolean, integer or floating point numbers for logical operations. If an expression has a non-zero value, it is TRUE; if the value is zero, it is FALSE.

Operation Expression Result
AND Performs Logical AND of X and Y.
Format <expr1>AND<expr2>
NOT Performs Logical NOT of X.
Format NOT<expr>
OR Performs Logical OR of X and Y.
Format <expr1>OR<expr2>
XOR Performs Logical XOR of X and Y.
Format <expr1>XOR<expr2>

Relational

Operation Expression Result
EQ Returns True if X is equal to Y.
Format <expr1>EQ<expr2>
GE Returns True if X is greater than or equal to Y.
Format <expr1>GE<expr2>
GT Returns True if X is greater than Y.
Format True if X is greater than Y.
LE Returns True if X is less than or equal to Y.
Format <expr1>LE<expr2>
LT Returns True if X is less than or below Y.
Format <expr1>LT<expr2>
NE Returns True if X is not equal to Y.
Format <expr1>NE<expr2>

Scientific

Operation Result
^ Returns Value of X raised to the power of Y.
Format <expr1>^<expr2>
ACOS Returns Arc cosine (angle in radians) of X radians.
Format ACOS(<expr>)
ASIN Returns Arc sine (angle in radians) of X radians.
Format ASIN(<expr>)
ATAN Returns Arc tangent (angle in radians) of X radians.
Format ATAN(<expr>)
COS Returns Cosine (angle in radians) of X radians.
Format COS(<expr>)
EXP Returns

Value of e raised to the power of X.

Note: EXP is the exponential (ex) value of an expression where X is the expression.

Format EXP(<expr>)
LOG Returns Natural logarithm (base e) of X.
Format LOG(<expr>)
LOG10 Returns Base 10 logarithm of X.
Format LOG10(<expr>)
SIN Returns Sine (angle in radians) of X radians.
Format SIN(<expr>)
TAN Returns Tangent (angle in radians) of X radians.
Format TAN(<expr>)

Shape Attribute

Operation Result
CreateARGBColor Returns A color value string based on the transparency value and RGB color codes provided.
Name Type The Input is the:
Inputs <COLOR_ALPHA> int Value ranging from 0 to 255 denoting the level of transparency.
<COLOR_RED> int Value ranging from 0 to 255 denoting the shade of red.
<COLOR_GREEN> int Value ranging from 0 to 255 denoting the shade of green.
<COLOR_BLUE> int Value ranging from 0 to 255 denoting the shade of blue.
Format

CreateARGBColor(<COLOR_ALPHA>,<COLOR_RED>,<COLOR_GREEN>,<COLOR_BLUE>)

Example

CreateARGBColor(255,135,255,132) returns {"ARGB": [255,135,255,132]}

This function can be used to provide the color attribute to other shape attribute functions that take a color string as one of their input parameters.

CreateBlinkRate Returns An integer that represents the time interval in which an object will blink at run time.
Name Type The Input is the:
Inputs <BlinkRate> int

Value ranging from 1 to 5 representing the time interval in which an object will blink.

The values are:

1 - 200 ms

2 - 400 ms

3 - 600 ms

4 - 800 ms

5 - 1000 ms

Format

CreateBlinkRate(BlinkRate)

Example

CreateBlinkRate(BLINKRATEPT)

If BLINKRATEPT is set to 2, the object blinks every 400 ms.

If BLINKRATEPT is set to a value that is beyond the valid range of 1 to 5, the object does not blink.

CreateFillMode Returns A formatted string containing information on the fill direction and bipolar properties of an object.
Name Type The Input is the:
Inputs <FillDirection> int

Value ranging from 1 to 4 denoting the direction of the fill.

The values are:

1 - Fill from bottom

2 - Fill from top

3 - Fill from left

4 - Fill from right

<Bipolar> Bool/ int

Value denoting the polarity of the fill.

This is a flag whose value is either 0 or 1.

0 denotes a normal polarity of the fill.

1 denotes a bipolar fill.

Format

CreateFillMode(FillDirection,Bipolar)

Example

CreateFillMode(FILLDIRPT,BIPOLARPT)

If FILLDIRPT is set to 1, the fill direction is Fill from Bottom.

If FILLDIRPT is set to a value that is beyond the valid range of 1 to 4, the fill direction is set to the values entered manually in the Rotation/Fill section of the Properties - Object window..

CreateFont Returns

A font based on the parameters provided.

Note: This is applicable to Text and TextButton objects only.

Name Type The Input is the:
Inputs <FontName> string Value representing the name of the font.
<FontStyle> int

Value ranging from 1 to 4 denoting the style of the font.

The values are:

1 - Regular

2 - Italic

3 - Bold

4 - Bold italic

<FontSize in TWIPS> int Value representing the size of the font in TWIPS.
<FontEffects> int

Value ranging from 1 to 4 denoting the effect that can be applied to the font.

The values are:

1 - None

2 - Strikethrough

3 - Underline

4 - Strikethrough and underline

Format

CreateFont(FontName,FontStyle,FontSize in TWIPS,FontEffects)

Example

CreateFont("Arial",1,200,1) returns {"FontName": "Arial", "FontStyle": 1,"FontSize" : 200, "FontEffects": 1}}"

CreateIndexColor Returns A formatted string representing a color based on the color indices supported by CIMPLICITY.
Name Type The Input is the:
Inputs <IndexValue> int

Value denoting the index number of the color.

Note: For the value of the index, access the RGB Editor.

Format

CreateIndexColor(IndexValue)

Example

CreateIndexColor(5) returns {"IndexColor": 5}

CreateLine Returns A formatted string representing a line based on the parameters provided.
Name Type The Input is the:
Inputs <LineStyle> int

Value ranging from 0 to 11, which represents the style of the line.

The values are:

0 - Mixed value

1 - Solid

2 - Long dash

3 - Long dash - space - dot

4 - Dash

5 - Long dash - dot - dot

6 - Round dot

7 - Dot - dot - space

8 - Long dash - long space - dot

9 - Dash - dot - space

10 - Long dash - dot

11 - None

<Color> string Formatted string representing the color of the line. This string can be created by the CreateARGBColor, CreateIndexColor, or CreateSysColor functions.
<Width> float Value specified in twips.
Format

CreateLine(LineStyle,Color,Width)

Example

CreateLine(LineStylePT,CreateARGBColor(255,100,100,100),11)

If the value of LineStylePT is changed from 1 to 2, the line style will change from solid to long dash.

If no value is provided to LineStylePT, the line style is set to the value entered manually in the Colors section of the Properties - Object window.

CreateOneColorGradientFill Returns A formatted string representing a gradient fill type that uses one color to create a gradient effect.
Name Type The Input is the:
Inputs <ShadingStyles> int

Value ranging from 1 to 7 representing the style of the shade.

The values are:

1 - Horizontal

2 - Vertical

3 - Diagonally upwards

4 - Diagonally downwards

5 - From a corner

6 - To a corner

7 - From the center

<ShadeVariant> int Value ranging from 1 to 4 representing the variant of the shade.
<Color> string Formatted string that represents the color of the gradient. This string can be created by the CreateARGBColor, CreateIndexColor, or CreateSysColor functions.
<Brightness> int Value ranging from 1 to 20 representing the brightness of the color gradient.
Format

CreateOneColorGradientFill(ShadingStyles,ShadeVariant,Color,Brightness)

Example

CreateOneColorGradientFill(1,1, CreateIndexColor(5),15) returns {"Fill": {"FillType": 2,"ShadingStyles": 1,"ShadeVariant": 1 ,"Color1": {"IndexColor": 5} ,"Brightness": 15}}

CreatePatternFill Returns A formatted string representing a pattern fill type that uses two colors to create different fill patterns.
Name Type The Input is the:
Inputs <PatternType> int

Value ranging from 1 to 24 representing the type of pattern to be used.

Note: For details of the index to be used, access the palette.

<Color> string Formatted string that represents the primary color of the pattern. This string can be created by the CreateARGBColor, CreateIndexColor, or CreateSysColor functions.
<PatternColor> string Formatted string that represents the secondary color of the pattern. This string can be created by the CreateARGBColor, CreateIndexColor, or CreateSysColor functions.
Format

CreatePatternFill(PatternType,Color,PatternColor)

Example

CreatePatternFill(1,CreateIndexColor(5), CreateARGBColor(255,100,132,135)) returns {"Fill": {"FillType": 2,"PatternType":1,"Color": {"IndexColor": 5},"PatternColor": {"ARGB": [255,100,132,135]}}}

CreateSolidFill Returns A formatted string representing a solid fill type.
Name Type The Input is the:
Inputs <Color> string

Formatted string that represents a color.

This string can be created by the CreateARGBColor, CreateIndexColor, or CreateSysColor functions.

Format

CreateSolidFill(Color)

Example

CreateSolidFill(CreateARGBColor(255,100,132,135)) returns {"Fill": {"FillType": 1, "Color": {"ARGB": [255,100,132,135]}}}

CreateSysColor Returns

A formatted string representing a color based on the system index colors supported by the operating system.

Note: Depending on the colors chosen in the Display properties, system colors may vary between computers. Use these colors only if you want your CIMPLICITY screen to follow the desktop color scheme.

Name Type The Input is the:
Inputs <SysColorIndex> int Zero-based value denoting a valid system color index.
Format

CreateSysColor(SysColorIndex)

Example

CreateSysColor(9) returns {"SystemColor": 9}

CreateTwoColorGradientFill Returns A formatted string representing a gradient fill type that uses two colors to create a gradient effect.
Name Type The Input is the:
Inputs <ShadingStyles> int

Value ranging from 1 to 7 representing the style of the shade.

The values are:

1 - Horizontal

2 - Vertical

3 - Diagonally upwards

4 - Diagonally downwards

5 - From a corner

6 - To a corner

7 - From the center

<ShadeVariant> int Value ranging from 1 to 4 representing the variant of the shade.
<Color1> string

Formatted string that can be generated using any of the color functions.

This string can be created by the CreateARGBColor, CreateIndexColor, or CreateSysColor functions.

<Color2> string

Formatted string that can be generated using any of the color functions.

This string can be created by the CreateARGBColor, CreateIndexColor, or CreateSysColor functions.

Format

CreateTwoColorGradientFill(ShadingStyles,ShadeVariant,Color1,Color2)

Example

CreateTwoColorGradientFill(1,1, CreateIndexColor(5), CreateIndexColor(2)) returns {"Fill": {"FillType": 4,"ShadingStyles": 1,"ShadeVariant": 1,"Color1": {"IndexColor": 5} , "Color2": {"IndexColor": 2} }}

String

Operation Result
| Will be substituted by double quotes in an expression.
Chr$ Returns

A one-character UTF-16 encoded UNICODE string.

The integer can be any valid 16-bit UNICODE code point from the Basic Multilingual Plane.

Name Type The Input is the:
Inputs <Code_Point> integer Integer value of the UNICODE code point.
Format

Chr$(<Code_Point>)

Example

The expression Chr$(12461)+Chr$(12486)+Chr$(12451) will display the Japanese text キティ.

Note: You do not need to use the Chr$ function to display the text. You can enter 16-bit UNICODE characters directly in CimEdit.

FindToken Returns

A one-based index for the given token.

If the token indicated is not found, the function returns 0.

Comparison Case Insensitive
Name Type The Input is the:
Inputs <Source_String> string Collection of tokens separated by one of the characters in the Token_Separators input.
<Token_Separators> string

List of all the valid characters (for example, ",.") used to separate tokens.

Any character in the Token_Separators string will separate tokens. If the separators are ",.", then both comma and period will separate tokens. Empty tokens are ignored.

Note: If a space is used in the token separators, it cannot be the last character in the separators.

<Token_To_Find> string A token in the Source_String.
Format

FindToken(<Source_String>, <Token_Separators>, <Token_To_Find>)

Example

FindToken("Green.Red,Black.White",",.","black") returns 3.

FindToken("a,b.c,,d..e,.f", ",.", <token>) returns 1, 2, 3, 4, 5, and 6 for tokens A, B, C, D, E, and F.

FindTokenCS Returns

A one-based index for the given token.

If the token indicated is not found, the function returns 0.

Comparison Case Sensitive
Name Type The Input is the:
Inputs <Source_String> string Collection of tokens separated by one of the characters in the Token_Separators input.
<Token_Separators> string

List of all the valid characters (for example, ",.") used to separate tokens.

Any character in the Token_Separators string will separate tokens. If the separators are ",.", then both comma and period will separate tokens. Empty tokens are ignored.

Note: If a space is used in the token separators, it cannot be the last character in the separators.

<Token_To_Find> string A token in the Source_String.
Format

FindTokenCS(<Source_String>, <Token_Separators>, <Token_To_Find>)

Example

FindTokenCS("Green.Red,Black.White",",.","black") returns 0.

FindTokenCS("Green.Red,Black.White",",.","Black") returns 3.

FindTokenCS("a,b.c,,d..e,.f", ",.", <token>) returns 1, 2, 3, 4, 5, and 6 for tokens a, b, c, d, e, and f.

FormatInt Returns An integer prefixed with trailing zeroes based on the parameters provided.
Name Type The Input is the:
Inputs <Value> int/real/string Value to be formatted.
<Width> int

If zero_filled is 1, Width is the length of the output after the trailing zeroes are prefixed to Value.

If zero_filled is 0, ignore Width.

<zero_filled> BOOL/int Value that indicates if the trailing zeroes will be prefixed to Value.
<UseDigitGrouping> BOOL/int Value that indicates if digit grouping will be applied to the formatted value.
Format

FormatInt(<Value>, <Width>, <is zero_filled>, <UseDigitGrouping>)

Example

FormatInt(123,6,1,0) returns 000123.

FormatInt(123456789,6,0,1) returns 123,456,789.

FormatReal Returns A real value prefixed with trailing zeroes based on the parameters provided.
Name Type The Input is the:
Inputs <Value> int/real/string Value to be formatted.
<Precision> int Number of digits in the value after the decimal to be retained.
<Width> int

If zero_filled is 1, Width is the length of the output after the trailing zeroes are prefixed to Value.

If zero_filled is 0, ignore Width.

<zero_filled> BOOL/int Value that indicates if the trailing zeroes will be prefixed to Value.
<scientific> BOOL/int Value that determines the scientific notation in which the Value is displayed.
<UseDigitGrouping> BOOL/int Value that indicates if digit grouping will be applied to the formatted value.

FormatReal(<RealValue>, <Precision>, <Width>, <is zero_filled>, <isscientific>, <UseDigitGrouping>)

Example

FormatReal(123.456,1,9,1,0,0 ) returns 0000123.5

FormatReal(123.456,1,9,1,1,0 ) returns 001.2e+002

FormatReal(123456789.456,1,9,1,0,1 ) returns 123,456,789.456

FormatText Returns A string that is truncated based on the parameters provided.
Name Type The Input is the:
Inputs <Value> int/real/string Value to be truncated.
<Max Width> int The number of characters to be displayed.
Format

FormatText(<Value>, <MaxWidth>)

Example

FormatText("GEDigital",3) returns GED.

FormatTimeAbsolute Returns A string that represents a specific number of seconds converted to a format of time calculated since 00:00 UTC on January 1, 1970.
Name Type The Input is the:
Inputs <Value> int/real/string The number of seconds to be converted.
<Format Type> int The number assigned to a format based on which the Value will be converted.
Number Format
1

h:mm tt

Note: tt represents a.m. or p.m.

2 HH:mm
3 HH:mm:ss
4 M/d/yy
5 MM/dd/yy
6 MM/dd/yyyy HH:mm:ss
7

YYYY:MM:DD:HH:MM:SS

Note: If you choose this format, you can only display values after 1995:01:01:00:00:00 (that is, January 1, 1995 at midnight). Values before this date are displayed as ----:--:--:--:--:--.

8 yyyy:MM:dd:hh:mm:ss
Format

FormatTimeAbsolute(<Value>, <Format Type>)

Example

FormatTimeAbsolute(123456789,4) returns 11/30/73.

FormatTimeAbsSubSec Returns A string that represents a specific number of sub seconds converted to a format of time calculated since 00:00 UTC on January 1, 1970.
Name Type The Input is the:
Inputs <Value> int/real/string The number of sub seconds to be converted.
<Format Type> int The number assigned to a format based on which the Value will be converted.
Number Format
1

h:mm tt

Note: tt represents a.m. or p.m.

2 HH:mm
3 HH:mm:ss
4 M/d/yy
5 MM/dd/yy
6 MM/dd/yyyy HH:mm:ss
7 YYYY:MM:DD:HH:MM:SS
8 yyyy:MM:dd:hh:mm:ss
9

MM-dd-yyyy HH:mm:ss.TTT

Note: TTT represents milliseconds

10

MM-dd-yyyy HH:mm:ss.TTTTTT

Note: TTTTTT represents microseconds

Format

FormatTimeAbsSubSec(<Value>, <Format Type>)

Example

FormatTimeAbsSubSec(123456789,4) returns 1/1/70.

FormatTimeRelative Returns A string that represents a specific number of seconds converted to a format of time.
Name Type The Input is the:
Inputs <Value> int/real/string The number of seconds to be converted.
<Format Type> int The number assigned to a format based on which the Value will be converted.
Number Format
1 DD:HH:MM:SS
2 HH.tenths
3 HH:MM:SS
4 MM.Tenths
5 MM:SS
Format

FormatTimeRelative(<Value>, <Format Type>)

Example

FormatTimeRelative(123456789,4) returns 2057613:1.

FormatTimeRelSubSec Returns A string that represents a specific number of sub seconds converted to a format of time.
Name Type The Input is the:
Inputs <Value> int/real/string The number of sub seconds to be converted.
<Format Type> int The number assigned to a format based on which the Value will be converted.
Number Format
1 DD:HH:MM:SS
2 HH.tenths
3 HH:MM:SS
4 MM.Tenths
5 MM:SS
6

DD:HH:MM:SS:TTT

Note: TTT represents milliseconds

7

DD:HH:MM:SS:TTTTTT

Note:TTTTTT represents microseconds

Format

FormatTimeRelSubSec(<Value>, <Format Type>)

Example

FormatTimeRelSubSec(123456789,4) returns 0.2.

FormatValueCustom Returns A customized string that is formatted based on the specified format.
Name Type The Input is the:
Inputs <Value> int/real/string Value to be formatted.
<Format_Specifier> string String representing the format to which the Value will be converted.
String Custom format
%d Signed decimal integer
%u Unsigned decimal integer
%f Decimal floating point number
%o Octal representation
%x Lowercase unsigned hexadecimal integer
%X Uppercase unsigned hexadecimal integer
%e Lowercase scientific notation (mantissa/exponent)
%E Uppercase scientific notation (mantissa/exponent)
%c Equivalent ASCII character
%% Inserts a percent (%) symbol after the Value
Format

FormatValueCustom(<Value>, <Format_Specifier>)

Example

FormatValueCustom(123.45,"%d") returns 123

FormatValueCustom(123,"%x") returns 7b

GetToken Returns A substring that is the zero-based token element in the string.
Name Type The Input is the:
Inputs <Source_String> string String containing a collection of tokens separated by one of the characters in the Token_Separators input.
<Token_Separators> string

String containing all the valid characters used to separate tokens (for example,",").

Any character in the Token_Separators string will separate tokens. If the separators are ",.", then both comma and period will separate tokens. Empty tokens are ignored.

Note: If a space is used in the token separators, it cannot be the last character in the separators.

<TokenIndex0Based> int Zero-based index of the token to be retrieved from the Source_String.
Format

GetToken(<source_string>, <Token_Separators>, <TokenIndex0Based>)

Example

GetToken("Green.Red,Black.White",",.",2) returns Black.

GetToken("a,b.c,,d..e,.f", ",.", <index>) returns a, b, c, d, e, and f for indexes 0, 1, 2, 3, 4, and 5.

InStr Returns An integer that is the one-based character position of the first occurrence of the substring that is searched for (after the start search position) in the source string.
Comparison Case Insensitive
Name Type The Input is the:
Inputs <Start_Pos> integer One-based character position where the search begins.
<Source_String> string String to be searched.
<Search_SubStr> string String to search for.
Format

InStr(<Start_Pos>, <Source_String>, <Search_SubStr>)

Example

InStr(1, "abba", "a") returns 1

InStr(1, "abba", "A") returns 1

InStr(2, "abba", "a") returns 4

InStrCS Returns An integer that is the one-based character position of the first occurrence of the substring that is searched for (after the start search position) in the source string.
Comparison Case Sensitive
Inputs Name Type The Input is the:
<Start_Pos> integer One-based character position where the search begins.
<Source_String> string String to be searched.
<Search_SubStr> string String to search for.
Format

InStrCS(<Start_Pos>, <Source_String>, <Search_SubStr>)

Example

InStrCS(1, "abba", "a") returns 1

InStrCS(1, "abba", "A") returns 0

InStrCS(2, "abba", "a") returns 4

Left Returns Extracts the first <Count> characters from the source strings and returns a copy of the extracted substring.
Inputs Name Type The Input is the:
<Source_String> string String to copy from.
<Count> integer Number of characters to copy.
Format Left(<Source_String>, <Count>)
Mid Returns The substring that is the specified number (<Count>) of characters long and starts at the one-based character position in the source string.
Inputs Name Type The Input is the:
<Source_String> string String from which the substring is being extracted.
<StartPos> int One based character position where the search begins.
<Count> int Number of characters to count.
Format Mid(<Source_String>, <StartPos>, <Count>)
Right Returns Extracts the last <Count> characters from the source string and returns a copy of the extracted substring.
Inputs Name Type The Input is the:
<Source_String> string String from which the substring is being extracted.
<Count> integer Number of characters to copy.
Format Right(<Source_String>,<Count>)
StrArrayCat Returns The concatenation of the elements of the string array point into a single string.
Name Type The Input is the:
Inputs <Point_ID> string array point String array point which is a concatenation of the elements of a string array point.
Format

StrArrayCat(<Point_ID>)

Example

If MYSTR is a string array point, where MYSTR[0] = "abc", MYSTR [1] = "de", and MYSTR [2] = "fgh", StrArrayCat(MYSTR) will return abcdefgh.

StrLen Returns The length of the string.
Name Type The Input is the:
Inputs <Source_String> string String whose length will be returned.
Format

StrLen(<Source_String>)

Note: If a string literal is used as an argument, the trailing spaces (if any) will not be included in the string length.

Example

StrLen(“ABC “) will return 3, not 4.

ToLower Returns The string in lowercase.
Inputs Name Type The Input is the:
<Source_String> string String that will be lowercase.
Format ToLower(<Source_String>)
ToUpper Returns The string in uppercase.
Inputs Name Type The Input is the:
<Source_String> string String that will be uppercase.
Format ToUpper(<Source_String>)
Trim Returns A string with the leading and trailing white space removed.
Inputs Name Type The Input is the:
<string> string String being trimmed.
Format Trim(<string>)