<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Understood!<div><br></div><div>My code is now:</div><div><br></div><div><div><font face="Andale Mono">:- mutable(astate, aio_state, aio_state(yes, no), ground, [attach_to_io_state]).</font></div></div><div><font face="Andale Mono"><br></font></div><div><div><font face="Andale Mono">enable_colours(Mode, !IO) :-</font></div><div><font face="Andale Mono">    get_astate(aio_state(_, Quiet), !IO),</font></div><div><font face="Andale Mono">    set_astate(aio_state(Mode, Quiet), !IO).</font></div><div><br></div><div>and the little test case of it:</div><div><br></div><div><div><font face="Andale Mono">main(!IO) :-</font></div><div><font face="Andale Mono">    aio.format("@bp: @tk: @cr: @:) @:| @:( \n", [], !IO),</font></div><div><font face="Andale Mono">    enable_colours(no, !IO),</font></div><div><font face="Andale Mono">    aio.format("@bp: @tk: @cr: @:) @:| @:( \n", [], !IO).</font></div></div><div><br></div><div>That's a much nicer way and thanks for pointing it out to me, again, my brain isn't that good lately.</div><div><br></div><div>Thanks,</div><div>Sean.</div><div><br></div><div><br><blockquote type="cite"><div>On 24 Aug 2024, at 13:27, Volker Wysk <post@volker-wysk.de> wrote:</div><br class="Apple-interchange-newline"><div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">attach_to_io_state</span></div></blockquote></div><br></div></body></html>