syntax:functions

### Table of Contents

# List of functions

## Number functions

Function | Description |
---|---|

Abs | Returns the absolute value of a number which is the distance of a number on the number line, from 0, without considering which direction the number lies |

ACos | Returns the arccosine - the angle, in radians, of the specified cosine. |

ArcTan | Returns the angle, in radians, whose tangent is the quotient of the arguments. |

ASin | Returns the arcsine - the angle, in radians, of the specified sine. |

ATan | Returns the arctangent - the angle, in radians, of the specified tangent. |

Ceiling | Rounds the specified number up to the nearest integer - or full, non-fractional number - towards positive infinity. |

Cos | Returns the cosine of the angle specified in radians. |

Div | Returns the quotient of the two number arguments. |

Exp | Raises the mathematical constant e to the power of the specified argument. |

Floor | Rounds the specified number down to the nearest integer - or full, non-fractional number - towards negative infinity. |

IsEven | Tests if the specified number is even and returns Boolean TRUE if so, or FALSE if not. |

IsOdd | Tests if the specified number is odd and returns Boolean TRUE if so, or FALSE if not. |

Log | Returns the natural logarithm of the specified number. |

Max | Returns the largest of the two arguments. |

Min | Returns the smallest of the two arguments. |

MRound | Rounds the specified number to the specified multiple. |

Pi | Returns the value of Pi (π): 3.1415926535897932384626433833… |

Pow | Raises a number to the power of the specified power. |

RandBetween | Generates a random integer between two numbers. |

Random | Generates a random number between 0 and 1. |

Rem | Returns the remainder of the quotient of the two specified numbers. |

Round | Rounds a number to the specified number of decimal digits. |

RoundXL | Rounds a number to the specified number of decimal digits using the Excel rounding logic. |

Sign | Determines whether the specified number is positive, negative, or zero. If positive the value 1 is returned. If negative, the value -1 is returned. If 0, then 0 is returned. |

Sin | Returns the sine of the angle specified in radians. |

Sqrt | Returns the square root of the specified number. |

Square | Returns the square of the specified number. |

Tan | Returns the tangent of the angle specified in radians. |

Truncate | Returns the integer part of the specified number. |

## Text functions

Note that all text functions that return a text value automatically convert their arguments into text.

Function | Description |
---|---|

Char | Returns the ASCII character associated with the specified character code. |

Code | Returns the UTF-8 code (from 0 to 2047) of the first character of the specified text. |

Compact | Removes repeating whitespace from the specified text, reducing it to a single space. |

Contains | Determines whether text contains the specified search string. |

Distance | This function returns the edit distance between the two specified text strings calculated as the Damerau-Levenshtein distance. |

EndsWith | A search function used to check if a string ends with a specific text value . |

Find | Finds the exact position of a specified string within the specified text and returns the position of the first character. |

IsRegExMatch | Determines if the specified text matches a regular expression ("RegEx") pattern. |

KeepAfter | Returns the characters after the first occurrence of a string in the specified text. |

KeepBefore | Returns the characters before the first occurrence of a string in the specified text. |

KeepBetween | Returns the characters between the first occurrence of a string and the first occurrence of a second string in the specified text. |

KeepChars | Keeps only the characters given in a string list and removes the others from the specified text. |

Left | Returns the specified number of characters from the left of the specified text as a text value. |

Len | Returns the number of characters (length) in the specified text value. |

LineBreak | Returns the line break character (in Windows). |

Lower | Returns the specified text converted to lowercase letters. |

Mid | Returns a substring of text from the specified text, a given number of characters long, and starting with the character at a given staring position. |

Mirror | Returns a string with the reverse order of characters as the specified text. |

PadStart | Pads the beginning of a text string with a specified string up to a total length. |

PadEnd | Pads the end of a text string with a specified string up to a total length defined. |

ParseFloat | Parses a number in scientific notation (specified as a text value) into a decimal number. |

Proper | Converts the specified text to the proper case (or "title case"). |

Quote | Returns a single quote character ('). |

RegExMatch | Returns the first substring that matches the specified regular expression pattern. |

RegExReplace | Replaces the first substring within the given text that matches the specified regular expression pattern (regex_text) with the given replacement string. |

Remove | Removes a substring from the specified text, a given number of characters long, and starting with the character at a given staring position. |

RemoveChars | Removes individual characters from the specified text. |

RemoveEnd | Returns text excluding the last specified number of characters, including spaces and non-printing characters. |

RemoveStart | Returns text excluding the first specified number of characters, including spaces. |

RemoveText | Removes all instances of the specified string from text. |

Replace | Replaces all instances of a specified string with a second specified string within text. |

ReplaceBetween | Replaces text between two specified strings. |

Right | Returns the specified number of characters from the right of a string as a text value. |

Sanitize | Replaces tabs and line breaks with spaces and removes hidden system characters with ASCII codes 0 to 31 in the specified text. |

StartsWith | A search function used to check if a string starts with a specific text value. |

Strip | Removes the first and the last characters from the specified text value. |

SubstringCount | Returns the number of instances of a string found within the specified text. |

Trim | Trims off all leading and trailing spaces, and other non-printing characters, from the specified text. |

TrimEnd | Trims off all trailing spaces and other non-printing characters from the specified text. |

TrimStart | Trims off all leading spaces and other non-printing characters from the specified text. |

Upper | Returns the specified text converted to uppercase letters. |

## Logical functions

Function | Description |
---|---|

False | Creates a Boolean value equal to FALSE. |

If | Evaluates a condition and returns a specified value if the condition is TRUE, or a second specified value if not. |

IfEmpty | Returns the result of a second expression if the result of the first expression is empty. Otherwise, it returns the result of the first expression. |

IfError | Returns the result of a second expression if the result of the first expression is an error. Otherwise, it returns the result of the first expression. |

In | Returns Boolean TRUE if the specified text is found within any of the values listed in a given string list. |

IsBoolean | Returns TRUE if the result of a given expression is a Boolean (either TRUE or FALSE). |

IsEmpty | Returns TRUE if the result of a given expression is an empty value. |

IsError | Returns TRUE if the result of a given expression is an error. |

IsInteger | Returns TRUE if the result of a given expression is an integer number. |

IsNumber | Returns TRUE if the result of a given expression is a number. |

IsNumeric | Returns TRUE if the result of a given expression is a number or text that looks like a number. |

IsText | Returns TRUE if the result of a given expression is text. |

True | Creates a Boolean value equal to TRUE. |

When | Returns the result of a given expression if a specified condition is TRUE. Otherwise, it returns empty value. |

## Date/time functions

Function | Description |
---|---|

AddHours | Adds the specified number of hours to the given date. |

AddMonths | Adds the specified number of months to the given date. |

AddYears | Adds specified number of years to the given date. |

Age | Returns the number of full years between the two given dates. |

AgeMonths | Returns the number of full months between the two given dates. |

Date | Converts the given date-time, as text, into a date-time value represented as a number (date-time serial value) according to the specified format string. |

Day | Returns the number of the corresponding day of the month, from 1 through 31, from the given date. |

DetectFormat | Detects the date/time format of the text date (or timestamp). |

Format | Converts the given data-time, as a date serial value, into a date-time text value formatted according to the specified format. |

FromUnixTime | Converts the specified Unix timestamp (the number of seconds since Jan 1st, 1970) to the numeric date-time serial value used in EasyMorph (and Excel). |

ISOWeekNumber | Returns the ISO week number which ranges from 1 to 53 from the specified date. |

IsTextDate | Determines if the entered term is a recognizable text date. |

IsWeekend | Returns TRUE if the given date falls on a weekend day (Saturday or Sunday). |

LocalTime | Converts a given UTC date-time into a local date-time. |

MakeDate | Returns a date serial number based on the specified year, month, and day numeric values. |

Month | Returns the corresponding month number, 1 through 12, from the given date. |

MonthEnd | Returns the date serial number of the last day of the month the specified date falls in. |

MonthName | Returns the abbreviated (3-letter) name of the month corresponding to the given month number, from 1 to 12. |

MonthNameLocal | Returns the abbreviated (3-letter) name of the month corresponding to the given month number, from 1 to 12, according to the current regional locale. |

MonthStart | Returns the date serial number of the first day of the month the specified date falls in. |

Now | Returns the current date-time as a date serial number. |

Today | Returns today's date as a date serial number. |

ToUnixTime | Converts the specified EasyMorph (and Excel) date-time serial value to a Unix timestamp (the number of seconds since Jan 1st, 1970). |

UTCTime | Converts the given local date-time value into a UTC date-time value. |

Weekday | Returns the corresponding day-of-the-week number, from 1 (Sunday) to 7 (Saturday), from the given date. |

WeekdayName | Returns the abbreviated name of the day the given date falls on. |

WeekEnd | Returns the date serial number of the last day (Saturday) of the week the specified date falls in. |

WeekStart | Returns the date serial number of the first day (Sunday) of the week the specified date falls in. |

Workdays | Returns the number of workdays (i.e. all days except Saturday and Sunday) between two specified dates. |

Year | Returns the year, as a four-digit number, from the given date. |

YearDay | Returns the number of days since Jan 1st of the date's year. |

## Financial functions

Function | Description |
---|---|

FV | Calculates the future value of a loan or an investment, based on a constant interest rate. |

IPmt | Calculates the payment on the interest for an investment over a given period. |

NPer | Calculates the number of periods for an investment based on periodic payments and interest rate. |

Pmt | Calculates the periodic payment of an annuity. |

PPmt | Calculates the payment on the principal for an investment over a given period. |

PV | Calculates the present value of a loan or an investment, based on a constant interest rate. |

Rate | Calculates the interest rate per period of an annuity. |

## File functions

Function | Description |
---|---|

CombinePath | Combines two given paths into one, intelligently dealing with backslashes and relative paths. |

Directory | Extracts the directory path from a specified full file path, excluding the file name. |

Filename | Extracts the filename (without extension) from a given full file path. |

FileExtension | Extracts the file extension (with dot) from a given full file path. |

IsPathRooted | Detects if the specified path to a file or folder contains a root. |

## Web functions

Function | Description |
---|---|

CombineURL | Combines a specified URL and URL path into one URL. |

Decode | Decodes a given text string using one of several decoding methods. |

Encode | Encodes a given text string using one of several encoding methods. |

HexDecode | Converts the provided hex string into a text value using one of several decoding methods. |

HexEncode | Converts the provided text value into a hex string using one of several encoding methods. |

HashHex | Calculates the hexadecimal hash of the given text value using one of several algorithms. |

HMACHex | Calculates a keyed hexadecimal hash of the given text value using one several algorithms. |

IsEmail | Determines if the given email address string is a properly formatted email address, returning TRUE if so, or FALSE if not. |

IsJSON | Returns TRUE if the specified argument can be parsed as a JSON object or JSON array. |

IsXML | Returns TRUE if the given text is an XML object. |

JSONValue | Extracts a single value or a JSON object/array from the specified node. |

URIDecode | Decodes a given URL string such as an entire URL or just query-string values. |

URIEncode | Encodes a given URL string such as an entire URL or just query-string values. |

XMLValue | Extracts a single value or an XML node from a specified node. |

## Special functions

Function | Description |
---|---|

AsNumber | Converts the given expression to a number. |

AsText | Converts the given value to text. |

Coalesce | Returns the first value in the given argument list that is not an empty value. |

ColumnExists | Tests whether a specified column name exists in the input dataset. |

Empty | Creates an empty value. |

Eval | Evaluates the given text expression as an EasyMorph expression. |

Error | Creates an error value with the specified error text. |

GUID | Creates a GUID, similar to the "Generate GUIDs" action. |

Hash | Calculates a 128-bit hash in Base64 encoding from the specified value. |

Match | Returns the position index of a given value in a list of specified values, separated by delimiter. |

Metadata | Returns project metadata - specific details about the project. |

Pick | Returns the value in the specified index position within a given text list, a list of text values separated by delimiter. |

System | Returns the system value specified by the given keyword argument. |

If you need a function that is not currently available in EasyMorph please feel free to make a feature request on the Community forum.

syntax/functions.txt · Last modified: 2023/11/24 20:34 by craigt