| Group: | Information and Control |
| See also: | existglobal |
| Function: | exist | |
| Description: |
exist tries to find if the input object exists or not. If the object exists, exist gives the typ of the object.
|
| Usage: | r = exist ("name") | |
| Input: | ||
| name | object name | |
| Output: | ||
| r | scalar | |
-1 object doesn't exist
0 object is empty, in quantletss each not asigned object is empty
1 object is numeric
2 object is text
3 object has type XPLTIME
4 object is a display
9 composed objects (lists)
If the argument of exist denotes a quantlet, 10 is added. E.g.
if there is an object 'cov=1' and the library("xplore") is loaded,
exist("cov") results in 11 (10 for proc and 1 for numeric).
exist will not find a global object.
If x is defined and it isn't a quantlet you can also use exist(x) instead of exist("x"). Then the result can never be -1.
x = matrix (2,4)
exist("x")
x = createdisplay(1,1)
exist("x")
exist("y")
Contents of exist [1,] 1 Contents of exist [1,] 4 Contents of exist [1,] -1
| Group: | Information and Control |
| See also: | existglobal |