Hi all,
It seems that Ax has two different root base classes: object and some kind of "internalobject"
I've always used some kind of calls like SysDictClass::isEqualOrSuperclass(classIdGet(obj), classNum(Object)) to distinguish between these different kind of inheritance hives.
Starting with Ax2012 the is operator can be used for inheritance checks. But it seems to be not possible, due to the lack of a missing InternalObject class, to use this for check if a passed class instance (derived from object or derived from "nothing")
The result of a call like if (instantiatedObjectVar is Object) seems to deliver true in all cases.
So I can use only the old construct if (! SysDictClass::isEqualOrSuperclass(classIdGet(obj), classNum(Object)) to check for a 'non-object ' object?
Is this a bug or is this the intended design?
Example:
public class MyChildFromInternalRoot
public class MyChildFromObject extends object
public static void checkTest(object obj) // some static method e.g. in MyTools Class
{
boolean b1;
str s1;
boolean bOK1;
boolean bOK2;
;
if (obj != null)
{
bOK1 = obj is Object;
bOK2 = SysDictClass::isEqualOrSuperclass(classIdGet(obj), classNum(Object));
info(strFmt('isObject: %1 %2',bOK1, bOK2));
s1 = obj.toString();
b1 = obj.objectOnServer();
}
}
MyChildFromInternalRoot obj1 = new MyChildFromInternalRoot();
MyChildFromObject obj2 = new MyChildFromObject();
;
MyTools::checkTest(obj2);
MyTools::checkTest(ob1);
regards Douglas