Hi there

I'm working on a project where I need to find the distance between up to 2000 points in 3D space.
It takes a lot of time on the nSpire CX calculator, so I wanted to make a progress bar, showing how far it was in the process.

Here is the code for the loading:

Code:
function getMaxDist()
   maxDist = 0
   for i = 1,molTable["nAtoms"] do
      for j = 1,molTable["nAtoms"] do
         local dist = math.sqrt((molTable[i]["x"] - molTable[j]["x"])^2  +  (molTable[i]["y"] - molTable[j]["y"])^2  +  (molTable[i]["z"] - molTable[j]["z"])^2)
         if dist > maxDist then
            maxDist = dist
         end
      end
   end
end


It's not finished, but you get the idea.

But I'm not able to update the screen while I'm inside the loop.
It only updates once it has finished.

Is there any possible way to make a loading bar in LUA on the nSpire CX?

regards
Frederik
Do platform.window:invalidate() somewhere in the script,right after 1 bar is loaded,I don't have time to read this,but that should make the bars load.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement