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:
x1=1
x2=2
x=list(x1,x2)
comp(x,"x1") ;existing element
comp(x,"x3") ;nonexisting element
comp("de","x3") ;nonexisting object "de"

Result:
position of x1 =1, 0 for nonexisting element x3, -1 for nonexisting

object de



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