New ND6 LotusScript Functions
With the release of Notes and Domino 6, the LotusScript language was upgraded from version 4 (that shipped with Notes 5) to version 5. There are several new functions added to LotusScript, and here we briefly go over some of them. - ArrayUnique. Pass in an array and an optional comparison method (0 = case & pitch sensitive, 1 = case insensitive, pitch sensitive, 4 = case sensitive, pitch insensitive, 5 = case & pitch insensitive) and you are returned an array of the unique values from the source array.
- Boolean data type. Used to hold True/False answers. Previously you had to use an Integer or a Variant to hold boolean values, which take up more space in memory than is needed.
- Byte data type. This can hold positive integers from 0 to 255, inclusive. A byte variable will take up less memory than an integer.
- CBool. Pass in an expression that can be evaluated and returns a True/False value, or pass in strings "True" or "False", and you are returned a boolean value.
- CByte. Similar to CInt and CDbl in that a string is converted to a number, but the data type returned is a byte data type.
- Implode. Pass in an array of strings and an optional delimiter, and all the strings are put together into one long string with the delimiter between each value (or a space if the delimiter is omitted). Works like @Implode in formula language.
- Join. Identical to implode. If you're more familiar with the formula language, Implode will make sense. If you're more familiar with JavaScript or Java, Join will make sense.
- Replace. Refer to the help for details, but this works like @Replace in the formula language. You take a source array, a comparison array, a replacement array, along with some optional parameters, and the source array is scanned. Elements in the source array that are also in the comparison array are replaced with the corresponding value in the replacement array.
- Shellid. Works like Shell in that it starts another program, but this function returns the task id (the one the operating system assigned) of the program, so you can work through other operating system calls to find out if the program is still running, for example.
- Split. It's the opposite of Implode/Join. Pass in a string and some optional parameters and the string is split up into an array of "words" (based on your passed-in delimiter or the space if the delimiter is omitted).
- StrToken. Pass in a string, a delimiter, the word number to find, and a comparison method (same comparison method as in ArrayUnique), and a substring is returned. The long string is split up based on the delimiter (for example, every space divides a word in a sentence). Once split, the word number to find is used to find the "nth" element in the split up string. This works like @Word in the formula language.
Refer to the help that comes with the ND6 designer for more details on these new LotusScript functions.