Validation

PropertyExpressionDescription
Validation
IsBinary(value)
Returns true if value can be successfully converted to binary. In Eightwire, binary is encoded as hexadecimal text to make it easier to handle. Usually (but not always), binary data starts with the prefix "0x"; this is followed by a sequence of two-digit hexadecimal numbers. For example "0x29ABE2" or just "29ABE2". The "0x" prefix helps to positively identify this data as binary instead of some other type of text. For example, the following expression returns True: IsBinary("0x29ABE2")
Validation
IsBoolean(value)
Returns true if value is a recognised Boolean value. The recognised Boolean values are: 1, 0, true, false, t, f, yes, no, y, n For example, the following expression returns True: IsBoolean("NO")
Validation
IsDate(value)
Returns true if value contains a valid date or datetime value. Eightwire recognises a wide range of date formats. Some common examples are: 23/04/2017 23/04/17 04-23-2017 04-23-17 23rd April, 2017 23-Apr-17 23.APR.2017 20170423 23/05/17 5/23/2017 Internally Eightwire uses 23-APR-2017, and this is the format that will be returned from functions like ToDate. For example, the following expression returns True: IsDate("23rd April 2017")
Validation
IsDateTime(value)
Returns true if value contains a valid date or datetime value. See IsDate and IsTime for examples of valid formats. For example, the following expression returns True: IsDateTime("23/4/2017 1:30pm")
Validation
IsNumber(value)
Returns true if value is a valid number. Valid numbers include integers, decimals and scientific notation. Eightwire recognises and can manipulate any standard number up to 28 digits. Scientific notation and numbers up to 38 digits are recognised and can be moved directly using Eightwire but cannot be manipulated using expressions. Examples of scientific notation are: 6.02E+23 1.60E-35 For example, the following expression returns True: IsNumber("-234533.50")
Validation
IsText(value
Returns true if value is text or can be converted directly into text, including an empty string or a string containing only chr(0). Because every type can be represented as text, this function will always return true unless value is null. For example, the following expressions both return True: IsText("Hello World") IsText("") However, the following will return False: IsText(null)
Validation
IsTime(value)
Returns true if value contains a valid time or datetime value. Eightwire recognises a wide range of time formats. Some common examples are: 45:00.0 1:45pm 1:45:00 p.m. Internally Eightwire uses 13:45:00.000000000, and this is the format that will be returned from functions like ToTime and ToDateTime. For example, the following expression returns True: IsTime("5:30am")
Validation
IsXML(value)
Returns true if value appears to contain XML. This function does not do a full validation check and it much quicker to run than IsValidXML. This function may return true even if the XML is malformed. For example, the following expression returns True: IsXML("<fox>quick</fox>")
Validation
IsValidXML(value)
Returns true if value contains valid XML. This function performs a full validation check. This function may be slow to run compared with IsXML because fully validating XML can be quite time-consuming. For example, the following expression returns True: IsValidXML("<fox>quick<fox>") In the following examples, IsXML would return True because it does not thoroughly check the XML, but IsValidXML would fully validate the XML and find an unclosed tag, so it would return False: IsXML("<fox><quick></fox>") returns true. IsValidXML("<fox><quick></fox>") returns false.
Validation
IsValidJSON(value)
Returns true if value contains valid JSON. This function performs a full validation check.
Validation
Contains(value, find)
Returns true if find is a substring of value. For example, the following expression returns true: Contains("quick brown fox", "bro")
Validation
BeginsWith(value, find)
Returns true if find matches the left-most portion of value. For example, the following expression returns true: BeginsWith("quick brown fox", "qui")
Validation
EndsWith(value, find)
Returns true if find matches the right-most portion of value. For example, the following expression returns true: EndsWith("quick brown fox", "ox")
Validation
IsEmpty(value)
Returns true if value, when converted to test, contains no characters – an empty string. For example, the following expression returns true: IsEmpty("")
Validation
IsIn(find, item [,.., item])
Returns true if find (the first parameter) matches any of the subsequent item parameters. You can call this function with 2 or more parameters. For example, the following expression returns true: IsIn("fox", "dog", "fox", "wolf", "dingo")
Validation
IsNull(value)
Returns true if value is null, is text containing a single chr(0) or is text containing the escape sequence "\0" – all valid representations of null. An empty string will return false because it is not null. For example, the following expressions all return true: IsNull(null) IsNull("\0") IsNull(chr(0))
Validation
IsNullOrEmpty(value)
Returns true if value is null (as described in IsNull) or empty (as described in IsEmpty).
Validation
Hash(value)
Returns a 22-character hash of value. The hash function is used to map data of arbitrary size to data of fixed size. The text returned by the hash function is called a hash code. The hash function uses the MD5 algorithm. A hash code cannot be reversed to recover the original data, nor is a hash code guaranteed to be unique for a given input – however for the vast majority of real-world circumstances it will be unique. Please note: Hashing is not encryption.
Validation
ShortHash(value)
Returns a 5-character hash of value. See hash, above. A 5-character hash is less likely to be unique for a given input than a 22-character hash. However, if your input data is usually short then a shorter hash will likely suffice. Please note: Hashing is not encryption.