Expression Editor Functions - Text Category

Function

Description of Returned Value

BinFormat

Formats a number as binary.

Format: BinFormat(number[, places])

If places is omitted, the minimum number of characters necessary are used. Places is useful for padding the returned value with leading zeros.

Char

Returns the character specified by the ASCII code number.

Format: Char(number)

Example: Char(252) returns ü.

Clean

Returns all non-printable characters from text.

Format: Clean(text)

Code

Returns a numeric code for the first character in a text string.

Format: Code(text)

Compare

Compares two text strings. Returns -1 if string1 < string2. Returns 0 if they are equal. Returns 1 if string1 > string2.

Format: Compare(string1, string2[ ,caseSensitive])

Concatenate

Joins several text strings into one text string. If any of the arguments is not a string value, it is converted to a string.

Format: Concatenate(string1, string2, ...)

DateFormat

Formats a date.

Format: DateFormat(date[, format])

If the format code is used, it must be entered with double quotation marks. Valid format codes include:

  • "%d" to return the day of the month
  • "%g" to return A.D. or B.C.
  • "%h" to return the hours
  • "%m" to return the minutes
  • "%M" to return the month
  • "%s" to return the seconds
  • "%y" to return the 2-digit year
  • "%z" to return the time-zone abbreviation

Dollar

Converts a number to text, using currency format.

Format: Dollar(number[, precision[, commas]])

Where:

  • Precision is the number of digits to the right of the decimal point. If precision is negative, number is rounded to the left of the decimal point. If precision is omitted, the value for default currency precision in Windows System Settings is used.
  • Commas specifies whether to include comma separators between thousands in the whole part of the number. If commas is omitted, the corresponding value in Windows System Settings is used.

Fixed

Formats a number as text with a fixed number of decimal places.

Format: Fixed(number[, precision[, commas]])

Fract

Formats a number as fractional.

Format: Fract(number[, mode])

HexFormat

Formats a number as hexadecimal.

Format: HexFormat(number[, places])

Left

Returns the left-most N characters from a string.

Format: Left(string[ ,N])

Len

Returns the number of characters in a text string. Spaces count as characters.

Format: Len(string)

Lower

Converts all uppercase letters in a text string to lowercase.

Format: Lower(string)

Mid

Returns a specified number of characters from a text string starting at the specified position. If num_chars is omitted, the maximum available number of characters is used.

Format: Min(string, start_num[ ,num_chars])

OctFormat

Formats a number as octal.

Format: OctFormat(number[, places])

Proper

Capitalises the first letter in each word of a text value.

Format: Proper(text)

Example: Proper("text") returns Text.

Replace

Replaces characters within text.

Format: Replace(old_text, start_num, num_chars, new_text)

Rept

Repeats text a given number of times.

Format: Rept(text, number_times)

Right

Returns the right-most characters from a text value.

Format: Right(text[, num_chars])

Roman

Converts an Arabic numeral to Roman, as text.

Format: Roman(number)

Search

Finds one text value within another.

Format: Search(find_text, within_text[, start_num[, case_sensitive]])

Substitute

Substitutes new text for old text in a text string a specified number of times.

Format: Substitute(text, old_text, new_text[ ,instance_num])

Text

Converts a value to text in a specific number format.

Format: Text(value, format_text)

Trim

Removes all spaces from string except for single spaces between words.

Format: Trim(string)

Upper

Converts all lower-case letters in a text string to upper-case.

Format: Upper(string)