alias example {
if ($com(bug)) {
.comclose bug
}
comopen bug MSScriptControl.ScriptControl
if ($comerr || !$com(bug)) {
echo -a Failed to create com
}
elseif (!$com(bug, language, 4, bstr, jscript)) {
echo -a Failed to set language
}
elseif (!$com(bug, ExecuteStatement, 1, bstr, example = 5.7)) {
echo -a Failed to execute jscript
}
elseif (!$com(bug, Eval, 1, bstr, example)) {
echo -a Failed to eval
}
else {
;; this returns 5.70000
echo -a This should be 5.7 :: $com(bug).result
}
if ($com(bug)) {
.comclose bug
}
}