Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Group: Information and Control
See also: list size

Function: comp
Description: Checks whether an object has a specific component or not. If the first argument is a string, the object with the specified name is regarded as a list object.

Usage: x = comp(obj, com)
Input:
obj list object or string
com string, the name of the component
Output:
x scalar

Note:

Example:

proc () = plot (z, d)
  if (comp (z, "x") && comp (z, "y"))    // check for existence
    show (d, 1, 1, z.x~z.y)
  endif
endp

d = createdisplay (1,1)
x = (1:100)/100
y = x^2
a = list (x, y)
plot (a, d)
Result:

a window with a plot of x^2

Group: Information and Control
See also: list size

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

(C) MD*TECH Method and Data Technologies, 17.8.2000