Qore Programming Language 1.16.0
Loading...
Searching...
No Matches
Qore Builtin Functions
Note
This section is out of date; qpp should be used to generate cpp files with bindings for Qore instead

Qore Builtin Functions

Handling Function Arguments

Function Return Value

Each Qore function should return a QoreValue giving the return value of the function. If the function does not return a value, then it should simply return QoreValue() as in the following qpp code:

QoreValue noop() [flags=CONTANT] {
return QoreValue();
}
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:276

Raising Exceptions in a Function

If your function raises an exception, then you must call ExceptionSink::raiseException() against the ExceptionSink argument to the function. In the case that your function raises a Qore-language exception, the function must always return QoreValue() as a return value. The following qpp code is an example:

nothing remove_signal_handler(softint signal) [dom=PROCESS] {
if (signal <= 0 || signal > QORE_SIGNAL_MAX) {
xsink->raiseException("REMOVE-SIGNAL-HANDLER-ERROR", "%d is not a valid signal", signal);
return QoreValue();
}
QSM.removeHandler(signal, xsink);
}
static QoreNothingNode * nothing()
returns a pointer to Nothing
Definition: QoreNothingNode.h:120