<div dir="ltr">Thanks Bill, I'll chew on all that and see how far I can get. Much appreciated.<div><br></div><div>iain</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 10, 2020 at 10:15 AM <<a href="mailto:bil@ccrma.stanford.edu">bil@ccrma.stanford.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Normally, s7_error (called either from C or scheme) sends its error <br>
message<br>
to the current error-port. It defaults to *stderr*, so in GUI-based <br>
apps,<br>
you may need to redirect the output to your interface. One example is<br>
s7/tools/grepl.c. Its evaluator function wraps up the s7_eval_c_string:<br>
<br>
old_port = s7_set_current_error_port(s7, s7_open_output_string(s7));<br>
...<br>
result = s7_eval_c_string(s7, text);<br>
errmsg = s7_get_output_string(s7, s7_current_error_port(s7));<br>
...<br>
<br>
and if errmsg is not NULL, it posts it somewhere (via <br>
glistener_append_text,<br>
since it's using the repl in glistener.c). Snd uses largely the same<br>
code (snd-motif.c and glistener.c if in gtk). See also s7.html under<br>
"glistener". If you don't want s7's error messages, you can go down<br>
a level via *error-hook*.<br>
<br>
I don't know why your program exits silently, but a first fix might be<br>
to wrap the string being evaluated in a catch (s7.html under "errors").<br>
If you're calling s7_apply_function, you may need to make sure<br>
a catch exists. In Snd, if I remember right, this involves<br>
top_level_catch (snd.c, snd-nogui.c, etc). Or you can use s7_call<br>
instead of s7_apply_function.<br>
<br>
<br>
</blockquote></div>