0 Members and 2 Guests are viewing this topic.
I just discovered this amazing editor! But on on OS 3.1 pressing an arrow key on the editor page causes it to crash with error, "attempt to call a boolean value." I was able to fix it by deleting this part:Code: [Select]--disable specific arrow key events (to trigger the on.arrowKey(direction) event)on.arrowUp=falseon.arrowDown=falseon.arrowRight=falseon.arrowLeft=false
--disable specific arrow key events (to trigger the on.arrowKey(direction) event)on.arrowUp=falseon.arrowDown=falseon.arrowRight=falseon.arrowLeft=false
But I'm wondering how nobody pointed this out yet; those lines have been there since v2.0A4!
Bug report: It is possible to go to the next item on the auto-completion menu with the return key but the arrow keys throw an "attempt to call a boolean value".EDIT: And [Shift] + [down key] at any time throws the same error.
Thanks again for this editor! Though, in JSE 2.0, there is no menu and clicking on the right key at the start menu (choose between a touchpad, clickpad or computer) throws the following error:About the autompletion menu, should it be possible to auto-activate it? And some keywords like "function" or "for" should come with a space.EDIT: I achieved to show the menu: just go to the home screen and then return to the document.
Hi Jens_K! You've made a really great script editor! Everything that I needed to know was either in the readme, self-explanatory, or understood through trial-and-error. I just can't figure out one thing; How do you run a script? I get that you have to press MENU > Code > Run, but I switch to the Run page and can't figure out what I'm doing! It says Click to run, but I click the center button, and nothing happens. Sometimes it returns an error that won't solve (even when pressing Menu and trying to let the editor solve the error). I'm on a Clickpad running OS 3.6, if that makes any difference at all.
Quote from: 123outerme on January 23, 2017, 05:05:45 pmHi Jens_K! You've made a really great script editor! Everything that I needed to know was either in the readme, self-explanatory, or understood through trial-and-error. I just can't figure out one thing; How do you run a script? I get that you have to press MENU > Code > Run, but I switch to the Run page and can't figure out what I'm doing! It says Click to run, but I click the center button, and nothing happens. Sometimes it returns an error that won't solve (even when pressing Menu and trying to let the editor solve the error). I'm on a Clickpad running OS 3.6, if that makes any difference at all. Hey, thanks for your feedback! Seems like on the execution page (usually 1.2), you're focusing the console, but the script executor waits with execution until it has the focus itself. To change focus you can press ctrl + tab. The script executor should then have a black outline instead of a grey one.I hope that helped. If it didn't, please send me your JSE file and some more infos about those errors!
while true do function on.paint(gc) function textDisp(x,y,str) gc:drawString(str,x,y) end end platform.window.invalidate()end
Hi Jens, another issue I'm having: I'm trying to run a script with several parts. I can't seem to run this code, it always takes extremely long, presumably forever, to load page 1.2:Code: [Select]while true do function on.paint(gc) function textDisp(x,y,str) gc:drawString(str,x,y) end end platform.window.invalidate()endI've tested that whole code block without the while block, yet it doesn't work with the while. Is there a problem with my code? Or could it be the editor?
x = 0timer.start(0.01)function on.timer() x = x + 1 --update screen platform.window:invalidate()endfunction on.paint(gc) gc:drawString("hi", x % 300, 20)end
Quote from: 123outerme on January 24, 2017, 05:46:37 pmHi Jens, another issue I'm having: I'm trying to run a script with several parts. I can't seem to run this code, it always takes extremely long, presumably forever, to load page 1.2:Code: [Select]while true do function on.paint(gc) function textDisp(x,y,str) gc:drawString(str,x,y) end end platform.window.invalidate()endI've tested that whole code block without the while block, yet it doesn't work with the while. Is there a problem with my code? Or could it be the editor?Nspire Lua programs have a different structure, they are event based; code outside of event handlers is usually only executed at the programs start and only for initialisation, which in your case takes an infinite amount of time due to your while loop, which is why your program doesn't respond.You can see the available events in the Nspire API guide (on page 2.1).To do what you wanted to do, you could use the timer to refresh the screen repeatingly:Code: [Select]x = 0timer.start(0.01)function on.timer() x = x + 1 --update screen platform.window:invalidate()endfunction on.paint(gc) gc:drawString("hi", x % 300, 20)endBut you don't have to update the screen repeatingly, whenever the Nspire forgets the screens content, it asks for an update by calling on.paint.If you have further questions, you can ask here: https://www.omnimaga.org/lua-language/ or send me a PM