findobj - finds a global object named str
oadl::findobj(str)
The findobj() function searches the global
symbol table for a symbol matching the name provided in str.
If found, it returns the value associated with that symbol. This can
be used to dynamically access global procedures, classes, objects, or
constants by name.
Returns the value of the global symbol if it exists and is of an
appropriate class (Procedure, Class, Object, Constant, or Extern). If
the symbol does not exist or is not a valid global type, it returns
nil.
ArgCheck is thrown if exactly one argument is
not provided.
TypeCheck is thrown if
str cannot be converted to a string.
v = oadl::findobj("main");
if (v != nil) {
"Found main: ", v, '\n';
}