FUNCTION InstanceOf LPARAMETERS oObject,cClassName LOCAL laClassHierarchy,lcClassName,llResult DIMENSION laClassHierarchy[1] IF VARTYPE(oObject)!="O" MyError("Parameter oObject must be of object type") ENDIF IF VARTYPE(cClassName)!="C" MyError("Parameter cClassName must be of character type") ENDIF lcClassName=UPPER(cClassName) ACLASS(laClassHierarchy,oObject) IF ASCAN(laClassHierarchy,lcClassName)>0 llResult=.T. ELSE llResult=.F. ENDIF RETURN llResult ENDFUNC