String - (Built-in Functions)
Expression Syntax: Bin(hex)
Examples:
Bin("00010203")
returns binary data of length 4 bytes with values 0, 1, 2, 3.
Expression Syntax: Find(string, searchstring)
string: The string, or property value representing a string, to search.
searchstring: The substring, or property value representing a string, to search for.
Returns
The position in the string of the first occurrence of the searchstring, starting at 0. -1 will be returned if searchstring is not found.
Example:
Find("aaa", "a") - will return 0
Find("The Cat", "Cat") - will return 4
Find("The Cat", "The") - will return 0
Find("The Cat", "Dog") - will return -1
Expression Syntax: FindW(string, searchstring)
string: The string, or property value representing a string, to search.
searchstring: The substring, or property value representing a string, to search for.
Returns
The position in the string of the first occurrence of the searchstring, starting at 0. -1 will be returned if searchstring is not found.
Example:
FindW("aaa", "a") - will return 0
FindW("The Cat", "Cat") - will return 4
FindW("The Cat", "The") - will return 0
FindW("The Cat", "Dog") - will return -1
Expression Syntax: FormatDate(date, format)
date: a date or a property representing a date
format: A C printf format specification, see Allowable formats.
Examples:
FormatDate(date(),"%d %B %Y")
would return day month year, i.e. 23 April 2014.
FormatDate(date(),"%x: %X")'
would return an automatic date and time for the current locale in the format; 23/04/2014: 10:30:38
Allowable formats:
The format parameter in the expression syntax can contain a combination of the following codes:
%a ‑ Abbreviated weekday name
%A ‑ Full weekday name
%b ‑ Abbreviated month name
%B ‑ Full month name
%c ‑ Date and time representation appropriate for locale
%d ‑ Day of month as decimal number (01 to 31
%H ‑ Hour in 24-hour format (00 to 23)
%I ‑ Hour in 12-hour format (01 to 12)
%j ‑ Day of year as decimal number (001 to 366)
%m ‑ Month as decimal number (01 to 12)
%M ‑ Minute as decimal number (00 to 59)
%p ‑ Current locale's A.M./P.M. indicator for 12-hour clock
%S ‑ Second as decimal number (00 to 59)
%U ‑ Week of year as decimal number, with Sunday as first day of week (00 to 51)
%w ‑ Weekday as decimal number (0 to 6; Sunday is 0)
%W ‑ Week of year as decimal number, with Monday as first day of week (00 to 51)
%x ‑ Date representation for current locale
%X ‑ Time representation for current locale
%y ‑ Year without century, as decimal number (00 to 99)
%Y ‑ Year with century, as decimal number
%z ‑ %Z ‑ Time-zone name or abbreviation; no characters if time zone is unknown
%% ‑ Percent sign
Example format combinations:
%d:%m:%y would return Day of the month: Month number: Year without century (as a decimal), i.e. 23:04:14.
%H:%M:%S would show Hour (24h-hour format): minute as decimal: second as decimal, i.e. 10:26:36.
Note: Date and time codes can be used in a print template. See the section commencing with the topic About Print Templates for details of print templates.
Expression Syntax: FormatFlt(float, format)
float: A floating point number or a property representing a floating point number.
format: A C printf format specification, see Allowable formats.
Example:
FormatFlt(2.3456789, "%10.3f")
Allowable formats:
The format string must have the following general form:
%[flags][width][.precision]type
Where the fields are as follows:
flags - can contain these characters: -+ #0
width - is an optional number
precision - is another optional number
type - is one of the following characters:
e - Scientific notation (mantissa/exponent), lowercase, example 3.9265e+2
E - Scientific notation (mantissa/exponent), uppercase, example 3.9265e+2
f - Decimal floating point, lowercase, example 392.65
g - Use the shortest representation: %e or %f, example 392.65
G - Use the shortest representation: %E or %F, example 392.65
An example format would be %10.3f
Expression Syntax: FormatInt(integer, format)
integer: An integer or a property representing an integer.
format: A C printf format specification, see Allowable formats.
Example:
FormatInt(89,"%10.3x")this will return a Hex value of 059
Allowable formats:
The format string must have the following general form:
%[flags][width][.precision]type
Where the fields are as follows:
flags - can contain these characters: -+ #0
width - is an optional number
precision - is another optional number
type - is one of these characters: cdiouxX
c - Character, example a (if 97 is entered in the integer field)
d - or i Signed decimal integer, example 392
o - Unsigned octal, example 610
u - Unsigned decimal integer, example 7235
x - Unsigned hexadecimal integer, example 7fa
X - Unsigned hexadecimal integer (uppercase), example 7FA
An example format would be %05d
Expression Syntax: FormatStr(string, format)
string: A string, or a property representing a string.
format: A C printf format specification, see Allowable formats.
Example:
FormatStr("This is a string","%10.16s")
this will return "This is a string".
Allowable formats:
The format string must have the following general form:
%[flags][width][.precision]type
Where the fields are as follows:
flags - can contain these characters: -+ #0
width - is an optional number
precision - is another optional number
type - must be the character s (string of characters)
An example format would be %10.10s
Expression Syntax: Hex(binary)
binary: The binary representation of an item.
Example:
Hex(WKB())
returns a value in the format “000000000140000000000000004010000000000000”
Expression Syntax: Left(string, bytes)
string: A string, or a property representing a string.
bytes: The number of bytes to return.
Example:
Left("Cadcorp",3)returns Cad
Expression Syntax: LeftW(string, bytes)
string: A string, or a property representing a string.
bytes: The number of characters to return.
Example:
LeftW("Cadcorp",3)
returns Cad
Expression Syntax: Len(string)
string: A string, or a property representing a string.
Example:
Len("Cadcorp software")
returns 16
Len(name$)
returns the length of name$
Expression Syntax: LenW(string)
string: A string, or a property representing a string.
Examples:
LenW("Cadcorp software")
returns 16
LenW(name$)
returns the length of name$
Expression Syntax: Local(string)
string: A string, or a property representing a string.
Example:
Local(1.000)
returns 1
See: http://msdn.microsoft.com/en-us/library/dd318702%28v=vs.85%29.aspx
SIS Desktop only supports:
LCMAP_HIRAGANA
LCMAP_KATAKANA
LCMAP_HALFWIDTH
LCMAP_FULLWIDTH
Expression Syntax: LocaleMapString
Example:
LocaleMapString("ja-JP",LMS_Katakana|LMS_FullWidth,"しんぶん")
returns シンブン
Expression Syntax: Lower(string)
string: A string, or a property representing a string.
Example:
Lower("CADCORP")
returns cadcorp
Expression Syntax: Lpad(string,number,character)
string: A string or a property representing a string.
number: The number of characters to pad or trim to.
character: The characters to use to pad the string.
Examples:
Lpad("This is some sample text",10,"x")
returns the first 10 characters, i.e. This is so. In this case the final x parameter has no effect. If the text in the first parameter was less than 10 characters, for example My Text, then x would pad the string to a total of 10 characters, i.e. xxxMy Text.
Lpad(text$,15,"-/")
returns the first 15 characters of text$ or text$ plus -/ padding to make a total of 15 characters, i.e. -/-/Sample Text.
Expression Syntax: LpadW(string,number,character)
string: A string, or a property representing a string.
number: The number of characters to pad or trim to.
character: The characters to use to pad the string.
Examples:
LpadW("This is some sample text",10,"x")
returns the first 10 characters, i.e. This is so. In this case the final x parameter has no effect. If the text in the first parameter was less than 10 characters, for example My Text, then x would pad the string to a total of 10 characters, i.e. xxxMy Text.
LpadW(text$,15,"-/")
returns the first 15 characters of text$ or text$ plus -/ padding to make a total of 15 characters, i.e. -/-/Sample Text.
Expression Syntax: Ltrim(string)
string: A string, or a property representing a string.
Examples:
Ltrim(" Cadcorp ")
returns Cadcorp
Ltrim(name$)
returns name$ with no leading spaces
Expression Syntax: Mid(string, start, bytes)
string: A string, or a property representing a string.
start: The position of the first byte to extract, the first character of the string being 1.
bytes: The number of bytes to extract. A negative number will return the characters from the start position to the end of the string.
Examples:
Mid("abcdefghij",1,3)
returns abc
Mid("abcdefghij",4,3)
returns def
Mid("abcdefghij",7,-1)
returns ghij
Expression Syntax: MidW(string, start, characters)
string
A string, or a property representing a string.
start
The position of the first byte to extract, the first character of the string being 1.
characters
The number of characters to extract.
A negative number will cause the characters from the start position to the end of the string to be returned.
Examples:
MidW("abcdefghij",1,3)
returns abc
MidW("abcdefghij",4,3)
returns def
MidW("abcdefghij",7,-1)
returns ghij
Expression Syntax: Replace(string,searchstring,replacestring)
string
The string, or property value representing a string, to search.
searchstring
The string, or property value representing a string, to search for and be replaced.
replacestring
The string, or property value representing a string, to replace the searchstring.
Example:
Replace(Name$, "St.", "Saint")
Searches the Name$ property for instances of "St." and replaces these with "Saint", i.e. "St. James Hospital" and "St. Johns Hospital", would become "Saint James Hospital" and "Saint Johns Hospital".
Expression Syntax: ReverseFind(string, searchstring)
string
The string, or property value representing a string, to search.
searchstring
The substring, or property value representing a string, to search for.
Example:
Left(Name$, ReverseFind(Name$," "))
Strip the names from the last part of the full name (after the last space). As an example the Name$ property may contain hospital names, i.e. "St. James Hospital", "St. Johns Hospital", "St Helens Paediatric Hospital", etc. This example would strip the word after the first space searching from the right, therefore returning "St. James", "St. Johns" and "St. Helens Paediatric".
Expression Syntax: ReverseFind(string, searchstring)
string
The string, or property value representing a string, to search.
searchstring
The substring, or property value representing a string, to search for.
Example:
Left(Name$, ReverseFindW(Name$," "))
Strip the names from the last part of the full name (after the last space). As an example the Name$ property may contain hospital names, i.e. "St. James Hospital", "St. Johns Hospital", "St Helens Paediatric Hospital", etc. This example would strip the word after the first space searching from the right, therefore returning "St. James", "St. Johns" and "St. Helens Paediatric".
Expression Syntax: Right(string, bytes)
string
A string, or a property representing a string.
bytes
The number of bytes to return.
Example:
Right("abcdefghij",3)
returns hij
Expression Syntax: RightW(string, bytes)
string
A string, or a property representing a string.
bytes
The number of characters to return.
Example:
RightW("abcdefghij",3)
returns hij
Expression Syntax: Rpad(string,number,character)
string
A string, or a property representing a string.
number
The number of characters to pad or trim to.
character
The characters to use to pad the string.
Examples:
Rpad("This is some sample text",10,"x")
returns the first 10 characters, i.e. This is so. In this case the final x parameter has no effect. If the text in the first parameter was less than 10 characters, for example My Text, then x would pad the end of the string to a total of 10 characters, i.e. My Textxxx.
Rpad(text$,15,"-/")
returns the first 15 characters of text$ or text$ plus -/ padding to make a total of 15 characters, i.e. Sample Text-/-/.
Expression Syntax: RpadW(string,number,character)
string
A string, or a property representing a string.
number
The number of characters to pad or trim to.
character
The characters to use to pad the string.
Examples:
RpadW("This is some sample text",10,"x")
returns the first 10 characters, i.e. This is so. In this case the final x parameter has no effect. If the text in the first parameter was less than 10 characters, for example My Text, then x would pad the end of the string to a total of 10 characters, i.e. My Textxxx.
RpadW(text$,15,"-/")
returns the first 15 characters of text$ or text$ plus -/ padding to make a total of 15 characters, i.e. Sample Text-/-/.
Expression Syntax: Rtrim(string)
string
A string, or a property representing a string to trim.
Examples:
Rtrim(" Cadcorp ")
returns Cadcorp with end spaces removed.
Rtrim(name$)
returns name$ with end spaces removed.
Expression Syntax: Sentence(string, fullstop)
string
A string to convert to 'sentence case', or a property representing a string.
fullstop
Should a full stop be added to the end of the string if one is not there? 0 will return the sentence without a full stop, -1 will return the sentence with a full stop.
Examples:
Sentence("the quick brown fox",0)
returns The quick brown fox
Sentence("the quick brown fox",-1)
returns The quick brown fox.
Expression Syntax: Str(number)
number
A number to be returned as a string.
Examples:
Str(1000)
returns 1000 as string.
Str(2^4)
returns 16 as a string.
Expression Syntax: Title(string)
string
A string to convert to 'title case', or a property representing a string.
Example:
Title("computer aided development limited")
returns Computer Aided Development Limited
Expression Syntax: Toggle(string)
string
A string to toggle the case, or a property representing a string.
Example:
Toggle("Cadcorp")
will toggle the case to become cADCORP.
Expression Syntax: Upper(string)
string
A string, or a property representing a string.
Example:
Upper("cadcorp")
returns CADCORP
Expression Syntax: Val(string)
string
A string, or a property representing a string.
Example:
Val("0.1e6")
returns 100000
Expression Syntax: VarType(property)
property
The property whose value is to be returned.
Examples of returns:
Integer = 3
FP = 5
date = 7
String = 8
Boolean = 11
This is achieved by 'escaping' invalid characters, eg converting ‘&’ to '&'
Expression Syntax: XmlAttributeEscape(string)
string
The string to be used as XML attribute
Examples of returns:
(Will be added)
This is achieved by 'escaping' invalid characters, eg converting ‘<’ to '<lt;'
Expression Syntax: XmlTextEscape(string)
string
The string to be used as XML attribute
Examples of returns:
(Will be added)
This is achieved by 'unescaping' invalid characters ( eg converting '&’ to ‘&’)
Expression Syntax: XmlUnescape(string)
string
The XML string to be converted into a normal string
Examples of returns:
(Will be added)