Debuggig JS & Version 4.0
At first, my questions regarding the debugging of JS code.
2) Becoming a bit more specific. How and where should I run my experiment to make debugging easiest? I tried running it locally, as I did with the python version. Though at one point when doing a quickrun OS stops opening a "stopped" field although it detects an error and only refers to the console. Afterwards I tried running it in the browser, where different errors occur and are detected. At least in the browser, I receive a proper error message - though one of them isn't particularly helpful (referring to a line in my JS code that does not exist). What kind of debug strategy would you recommend? Running in browsers or running locally and using the console for debugging?
The "occurred online None" - is really giving me a hard time here :D.
4) Second question on my current code. When running the experiment in browser, I receive an error calling that one variable that is referred to in a sketchpad as [blocknumber] does not exist. I do define the variable via:
blocknumber = 1 and:
vars.blocknumber = blocknumber in a prior inline_js. So how comes it is not found from the sketchpad? I can imagine that this has something to do with how variables and functions declared in inline_js are transferred between items in OS- though I thought that that would have become more intuitive with the new version, right?
5) Following that error, my browser presents another error found. I guess it occurs because I still have a vars.set() statement in my inline_js which I know does not work. Still, it thought to include this error here because of a detail in the error message, referring to a code line 4137 in my inline_js, although the script only has ~140 lines.
6) Now one question related more the updated in the new version. As said above, the experiment I'm working on was first build locally using inline_python. Yesterday I thought giving the 4.0 OS version a try. But when I try running my stable python version I receive new errors. In my former version, I used a
self.sleep() statement to manipulate time. Now it seems that in the newer version, OS is no more capable of referring to self (it gives me an error stating that). I changed to
import time and
time.sleep() though now my code runs way slower (might also be due to the general update and not this specific line). Can you tell me if/ why the update has precluded the self to be called? And do you have other recommendations other than time.sleep() as alternatives?
Sorry for the very long post and thank you a lot in advance!