Call the BEE Function or Command named by funcname. The arguments can be set via param%funcname:argname variable before the function call. The result can be accessed by means of result%funcname.
Please note that the parameters are to be set exactly as they appear in the calling statement. If a variable is to be passed, please use "(var)…" instead of BEE_var(). If you want strings to be BEE evaluated, please use BEE_get(). Object function calls need to set the object name as the "this" parameter instead of including it in the function name. For example:
<script language="bee">
myobj%myfunc argone="abc" argtwo="(var)myvar" timenow="{sys%time}";
foreach (result%myfunc) display "{foreach:key}: {foreach}<br>\n";
</script>
is equivalent to
<?php
$param["argone"] = "abc";
$param["argtwo"] = "(var)myvar";
$param["timenow"] = BEE_get("{sys%time}");
$param["this"] = "myobj";
BEE_set("param%myfunc", $param);
BEE_do("myfunc");
$result = BEE_get("(var)result%myfunc");
foreach ($result as $k => $v) printf("$k: $v<br>\n");
?>
Please note that the first four groups of BEE Commands, Variable Operations, Conditional, Loop and Module Calling, CANNOT be called via BEE_do(), with the exeption of "clear", "group", "include" and "exec" (which you can use even they fall into one of the four groups).
|