<div dir="ltr"><div>...even more strange than the reported bug:</div><div>clc(1) seems to behave different when directly written into the console vs used from SciNotes.</div><div><br></div><div>from SciNotes:</div><div><br></div><div><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(50,185,185)"><span style="color:rgb(50,185,185)">clc</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(160,32,240)">for</span> <span style="color:rgb(0,0,0)">i</span><span style="color:rgb(92,92,92)">=</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(188,143,143)">10</span> <span style="color:rgb(50,185,185)">mprintf</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">%d\n</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">i</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(160,32,240)">end</span>
<span style="color:rgb(50,185,185)">clc</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(74,85,219)">)</span></span><span style="color:rgb(74,85,219)"></span></pre></div><div><div>result in console:</div><div> 1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div><div>7 // note that number 8,9,10 are cleared..so it's 3 lines, not only two<br></div><div><br></div><div>--></div><div><br></div><div>code directly put into console...do this step by step<br></div><div>--> clc();<br></div><div>--> for i=1:10 mprintf("%d\n",i) end</div><div>1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div><div>7</div><div>8</div><div>9</div><div>10</div><div><br></div><div>--> clc(1)<br></div><div>
<div>1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div><div>7</div><div>8</div><div>9</div><div><br></div><div>--> // works as expected<br></div></div><div><br></div><div>tested on win7, Scilab 6.0.2</div><div><br></div><div>best regards,</div><div>Philipp<br></div><div><br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Do., 12. Dez. 2019 um 23:20 Uhr schrieb Samuel Gougeon <<a href="mailto:sgougeon@free.fr" target="_blank">sgougeon@free.fr</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<div>Hello Chin Luh</div>
<div><br>
</div>
<div>Le 12/12/2019 à 17:10, Chin Luh Tan a
écrit :<br>
</div>
<blockquote type="cite">
<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>
</div>
</blockquote>
<br>
<p>I could not think using disp(). According to its expected
behavior, it always appends an \n, while we want to stay on the
line, what's the purpose of \r instead of \n, and mprintf() does
not append anything to what it is requested to display.<br>
</p>
<p><br>
</p>
<blockquote type="cite">
<div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10pt">it seems that the mprintf also kind of broken?
as it needs 3 \n to get this result?<br>
</div>
</blockquote>
<p><br>
I do not think that disp() is broken. It looks OK, while <a href="http://bugzilla.scilab.org/show_bug.cgi?id=16143" target="_blank">clc(1)
is bugged</a>. This is why extra \n are required for this
workaround using clc.<br>
<br>
</p>
<blockquote type="cite">
<div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10pt">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>
</div>
</blockquote>
<p><br>
</p>
<p>Now that you know the clc code, please do not hesitate to propose
a patch for its clc(1) bug ;-))</p>
Regards<br>
<p>Samuel</p>
<p><br>
</p>
</div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote></div>