NAME

findobj - finds a global object named str

SYNOPSIS

oadl::findobj(str)

DESCRIPTION

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.

RETURN VALUE

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.

ERRORS

ArgCheck is thrown if exactly one argument is not provided.
TypeCheck is thrown if str cannot be converted to a string.

EXAMPLE

    v = oadl::findobj("main");
    if (v != nil) {
        "Found main: ", v, '\n';
    }

SEE ALSO

objname
pubname