int call(address [a1 ...])
address - address of user-defined or dll function. For user-defined functions, you can also use function's name as string, or QM item id.
a1 ... - arguments.
Usually you call functions by name. Function call calls it by address or by variable name or item id. This allows you to choose a function at run time. Use operator & to get function address.
Returns called function's return value, which must be of type int.
Argument types and number must match exactly. They are not converted. Composite types (str, interface pointers, etc) cannot be passed by value. Variables passed by reference must be with operator &, like &var.
If the user-defined callback function throws error, error is not generated in caller, and call just returns 0. If you use err statement after call, it catches only "invalid function address" and similar errors, but not errors in callback function.
Function myfunction: function# int'a double'b ... ________________________________ Call myfunction in usual way: int i = myfunction(5 10) Call myfunction with call: int fa = &myfunction int i = call(fa 5 10.0) or: str fn = "myfunction" int i = call(fn 5 10.0) or: int iid = qmitem("myfunction") int i = call(iid 5 10.0)