Caché Programming Orientation Guide
System Functions
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   
Search:    

System Functions
This section highlights some of the most commonly used system functions in ObjectScript.
The names of these functions are not case-sensitive.
The Caché class library also provides a large set of utility methods that you can use in the same way that you use functions. To find a method for a particular purpose, use the InterSystems Programming Tools Index.
See also Date and Time Values,” later in this chapter.
Value Choice
You can use the following functions to choose a value, given some input:
Existence Functions
You can use the following functions to test for the existence of a variable or of a node of a variable.
List Functions
ObjectScript provides a native list format. You can use the following functions to create and work with these lists:
There are additional list functions as well.
If you use a list function with a value that is not a list, you receive the <LIST> error.
Note:
The system class %Library.List is equivalent to a list returned by $LISTBUILD. That is, when a class has a property of type %Library.List, you use the functions named here to work with that property. You can refer to this class by its short name, %List.
Caché provides other list classes that are not equivalent to a list returned by $LISTBUILD. These are useful if you prefer to work with classes. For an introduction, see Collection Classes,” later in this book.
String Functions
ObjectScript also has an extensive set of functions for using strings efficiently:
Working with Multidimensional Arrays
You can use the following functions to work with a multidimensional array as a whole:
To work with an individual node in an array, you can use any of the functions described previously. In particular:
Character Values
Sometimes when you create a string, you need to include characters that cannot be typed. For these, you use $CHAR.
Given an integer, $CHAR returns the corresponding ASCII or Unicode character. Common uses:
The function $ASCII returns the ASCII value of the given character.
$ZU Functions
In existing code, you might see items like $ZU(n), $ZUTIL(n), $ZU(n,n), and so on, where n is an integer. These are the $ZU functions, which are now deprecated and are no longer documented. They are still available, but users are encouraged to replace them with methods and properties in the Caché class library that perform the equivalent actions. There is a table of replacements in Replacements for ObjectScript $ZUTIL Functions in the Caché ObjectScript Reference.