Author Topic: Strange behavior of Lua drawString  (Read 2908 times)

0 Members and 2 Guests are viewing this topic.

Offline DebboR

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 14
  • Rating: +6/-2
    • View Profile
Strange behavior of Lua drawString
« on: March 27, 2014, 01:00:16 pm »
Hello,


I have a little question concerning Lua's drawString on my nspire. I have OS 3.1 cas running (nlaunch) on my non-cas touchpad nspire.
It works great, except for one little issue: when I open Lua files that print numbers on the screen using drawString, the numbers get all messed up. For example: when I write 2, it turns into: 6.132164321546e-227 or something similar.


I think the fault happens when I call gc:tostring(theNumberToGetStringified), because if I draw "2", it works fine.


Is this a bug with nLaunch? Can I do something to prevent this from happening?


Thank you!
DebboR

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Strange behavior of Lua drawString
« Reply #1 on: March 27, 2014, 06:53:02 pm »
Wel, considering that drawString just draws string and doesn't manipulate strings I suppose some calculation in your code must have a little bug :) Try checking what you're actually drawing to the screen.

Edit: wait, maybe it is an Nlaunch problem: http://www.omnimaga.org/general-calculator-help/(bug)-mathematical-errors-while-nlaunched-into-cas-os-on-a-cx/. Are you running the latest versions of Ndless 3.1 and Nlaunch? This bug should have been fixed.

« Last Edit: March 27, 2014, 06:57:27 pm by Jim Bauwens »

Offline DebboR

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 14
  • Rating: +6/-2
    • View Profile
Re: Strange behavior of Lua drawString
« Reply #2 on: March 30, 2014, 02:22:38 pm »
Thanks, updating to nLaunchy indeed solved the problem :-)


DebboR