<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>Hi Samuel, <br></div><div><br></div><div>Thanks for your reply. <br></div><div><br></div><div>Previously I was using clc(linenumtoclear) for showing this effect in scilab, but i never thought of the mprintf, i was using disp that time<br></div><div><br></div><div>for i = 1:100 <br></div><div>disp("Static counter : " + string(i)); <br></div><div>sleep(1); clc(1) <br></div><div>end<br></div><br>it seems that the mprintf also kind of broken? as it needs 3 \n to get this result?<br><br>I also tried to look into the clc C source and see whether I could use the c code of clc in scilab api but no luck, but your example of mprintf which need 3 \n inspired me to look into the mprintf c code and see how it works. <br><br>I will get back to you on this, thanks again.<br><br>rgds,<br>CL<br><div data-zbluepencil-ignore="true" style="" class="zmail_extra"><br><div id="Zm-_Id_-Sgn1">---- On Thu, 12 Dec 2019 04:09:25 +0800 <b>Samuel Gougeon <<a target="_blank" href="mailto:sgougeon@free.fr">sgougeon@free.fr</a>></b> wrote ----<br></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); padding-left: 6px; margin: 0px 0px 0px 5px;"><div><div class="x_29633741moz-cite-prefix">Le 11/12/2019 à 14:31, Chin Luh Tan a
      écrit :<br></div><div><br></div><p><br></p><p>In the C API i don't know, but in Scilab language, <a target="_blank" href="http://bugzilla.scilab.org/show_bug.cgi?id=14642">this
        mprintf("..\r") feature is broken</a>.<br></p><p>It is possible to mimik it with (example):<br></p><pre style="font-family: Monospaced;font-style: normal;"><span class="colour" style="color:rgb(160, 32, 240)">for</span> <span class="colour" style="color:rgb(0, 0, 0)">i</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(188, 143, 143)">1</span><span class="colour" style="color:rgb(255, 170, 0)">:</span><span class="colour" style="color:rgb(188, 143, 143)">100</span>
    <span class="colour" style="color:rgb(50, 185, 185)">mprintf</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(188, 143, 143)">"Static counter: %d\n \n\n"</span><span class="colour" style="color:rgb(0, 0, 0)">,i</span><span class="colour" style="color:rgb(74, 85, 219)">)</span>
    <span class="colour" style="color:rgb(50, 185, 185)">sleep</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(188, 143, 143)">300</span><span class="colour" style="color:rgb(74, 85, 219)">)</span>
    <span class="colour" style="color:rgb(50, 185, 185)">clc</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(188, 143, 143)">1</span><span class="colour" style="color:rgb(74, 85, 219)">)</span>
<span class="colour" style="color:rgb(160, 32, 240)">end

<span class="colour" style="color:#000000">Samuel</span></span><br></pre><p><br></p></div>_______________________________________________<br>users mailing list <br><a target="_blank" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a> <br><a target="_blank" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a> <br><blockquote><div style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10.0pt;"><div>Hi,<br></div><div><br></div><div>I am trying to print some progress of a for loop in C api
          which will print the output in scilab console using the
          sciprint.<br></div><div><br></div><div>Is there anyway to print the output to a same line as
          normal C printf could be achieved using '\r' ? <br></div><div><br></div><div>e.g.:<br></div><div><br></div><div>currently my out out showing:<br></div><div><br></div><div>Train Epoch: 10 [ 1000/15416] Loss: 0.5961 <br></div><div>Train Epoch: 10 [ 2000/15416] Loss: 0.6794<br></div><div>Train Epoch: 10 [ 3000/15416] Loss: 0.3965<br></div><div>Train Epoch: 10 [ 4000/15416] Loss: 0.8110<br></div><div>Train Epoch: 10 [ 5000/15416] Loss: 0.7892<br></div><div><br></div><div>I would like to have the output to show on the same line. <br></div><div><br></div><div>I tried \r with fflush(stdout) it seems not working.<br></div><div><br></div><div>Thanks.<br></div><div><br></div><div>rgds,<br></div><div>Chin Luh<br></div></div></blockquote></blockquote></div><div><br></div></div><br></body></html>