String Functions
String functions format alphanumeric data for display and for communications between the In-Sight vision system and a remote device.
- Index parameters are zero-based. In other words, the first character of a string has an index of 0, the second character has an index of 1, and so on.
- Text strings that are one character wider than the cell width are sometimes clipped. Increasing the column width or adding a space character to the string will display the entire string.
Function |
Description |
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns the integer value corresponding to the ASCII code for the first character in a string. |
|||||||||||||||||||||||||||||||||||||
Returns the concatenation of multiple alphanumeric text strings. Numeric arguments are automatically converted to text. Note: The In-Sight 2000-110/120/120C vision sensor is only capable of returning Pass/Fail data as Output data, and the return value is converted to 0 or 1.
|
|||||||||||||||||||||||||||||||||||||
Encrypt(Key, Value, Output Format) |
Encrypts result data and returns an encrypted string. For more information, see Encrypt. |
||||||||||||||||||||||||||||||||||||
Returns 1 if Text1 and Text2 are identical, else 0. Note: Exact is case-sensitive.
|
|||||||||||||||||||||||||||||||||||||
Returns the indexed position of the string Text1 contained in the string Text2. The search for Text1 starts at the optionally-specified StartChar position within Text2. Note:
Find is case-sensitive.
|
|||||||||||||||||||||||||||||||||||||
Returns a text string constructed using a "C" library standard Format-string. Tip: The FormatString
function supports most Format-string parameters. Use the FormatString
dialog to automatically configure the parameters within In-Sight Explorer. For more information, see Format String Dialog.
Note:
|
|||||||||||||||||||||||||||||||||||||
Returns the leftmost number of characters (NumChars) from a Text string. |
|||||||||||||||||||||||||||||||||||||
Returns the number of characters (bytes) in a Text string. |
|||||||||||||||||||||||||||||||||||||
Returns Text converted to lowercase. |
|||||||||||||||||||||||||||||||||||||
Returns the Text starting from the indexed StartChar position in the alphanumeric string, for as many characters as specified by NumChars. |
|||||||||||||||||||||||||||||||||||||
Returns SrcText, modified by NewText at the indexed position StartChar. |
|||||||||||||||||||||||||||||||||||||
Returns the rightmost number of characters (NumChars) from a Text string. |
|||||||||||||||||||||||||||||||||||||
Returns the index of the first character in SrcText that is also contained in CharList. If no characters in SrcText are present in CharList, the function returns the length of SrcText. Note: Strcspn is
case-sensitive.
|
|||||||||||||||||||||||||||||||||||||
Returns a text string constructed using a "C" library standard Format-string. Tip: The FormatString
function supports most Format-string parameters; use the FormatString
dialog to automatically configure the parameters within In-Sight Explorer. For more information, see Format String Dialog.
Note:
Available Format-string parameters are:
The following Format-string parameters are used primarily for text formatting. For example, formatting the text of an email message in the WriteSMTP function:
|
|||||||||||||||||||||||||||||||||||||
Returns the index of the first character in SrcText that is not contained in CharList. If all characters in SrcText are also in CharList, the function returns the length of SrcText. Note: Strspn is case-sensitive.
|
|||||||||||||||||||||||||||||||||||||
Converts numeric characters (decimal, hexadecimal and octal) at the beginning of an alphanumeric string into an integer. Hexadecimal characters must begin with "0x"; octal characters must begin with "0". |
|||||||||||||||||||||||||||||||||||||
Returns a text string constructed by substituting NewText for each occurrence of OldText in SrcText. If an optional Instance index is specified, then only that instance of the text will be replaced. |
|||||||||||||||||||||||||||||||||||||
Returns the text located at the specified Instance index (occurrence) of a delimited string. The Delimiter must be enclosed in quotes (") in the function. |
|||||||||||||||||||||||||||||||||||||
Returns Text stripped of leading and trailing spaces, leaving only a single space between words (if any). All control characters (Carriage Return, Line Feed, etc.) are also stripped. |
|||||||||||||||||||||||||||||||||||||
Returns Text converted to uppercase. |
|||||||||||||||||||||||||||||||||||||
Returns the floating point value of NumericText. Subsequent non-numeric characters are ignored. |