Capy-Bearer Documentation

call

host call

Capy

function call(handle : module, name : string) dval
function call(handle : module, name : string, input : as dval) dval

Description

call() calls an exported function in a loaded unit. It returns the result as dval.

Use unit_load() once when several calls use the same unit. The two-argument form passes an empty dval.

Parameters

handle : a value from unit_load()

name : an exported function name

input : optional dval input

Return Values

The exported function result.

Example

Capy

var handle := unit_load("/doc/examples/call_target.capy")
var result := call(handle, "echo", {name: "Ada"})
print(string(result.name), "\n")