chromosundrift [Lexaloffle Blog Feed] weird bug using dir() in program <p> <table><tr><td> <a href="/bbs/?pid=19467#p"> <img src="/bbs/thumbs/pico19466.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=19467#p"> weird bug using dir() in program</a><br><br> by <a href="/bbs/?uid=12349"> chromosundrift</a> <br><br><br> <a href="/bbs/?pid=19467#p"> [Click to Play]</a> </td></tr></table> </p> <p>Zep, I think I have found a bug but I don't know whether you would agree.</p> <p>First, here's what happens when I type the &quot;dir&quot; in the console:</p> <p>&gt; dir<br /> directory: /test/<br /> dirtest.p8<br /> dirtest.p8.png</p> <p>Which is what I expected, only this cart is saved. Here's the code entered into the editor to reproduce this bug:</p> <p>x=dir()<br /> cls()<br /> print(x)</p> <p>and the result is it prints (on a clear screen) the following:</p> <p>nil<br /> dirtest.p8<br /> dirtest.p8.png</p> <p>I suppose the value of x is nil because dir() doesn't return anything. And I suppose the dir contents are printed after because the threading model is weird.</p> Tue, 29 Mar 2016 05:10:11 UTC