Usage questions
-
Hi everyone!
I'm looking to find some information I could not locate in the documentation.I've got a bunch of questions, every bit of help is appreciated. Thanks in advance to anyone that replies!
If there is a proper way to check what type of variable has been passed into a function
(I've found you can check between string and number with (x+0)==x, but nothing for other types like arrays or structs)If there is a way to delete data from the end of the file (from open()) to reduce it's size again
if you can store chr(0) in a string to store 0 in the file for binary like formats (since write requires a string and read returns one too) or a way to read a byte / byte[] from a file
Any type of error handling (protected function calls, try catch or whatever else?)
-
✓ Answered
Any way to run code from another script/program without having to copy and paste into each file?
[No, I'm afraid not at this point] (Martin) -
✓ Answered
A way to check if the analog sticks are pressed like buttons?
[Yes - read the controls into a var (c for example) and then test for c.lc or c.rc] (Martin) -
✓ Answered
Any way to get the script to/from the switch without manually copying?
[As per 5 - not at this point in time. This is a restriction we have to work with from Nintendo at this time.] (Martin)
Any way to check if an element exists in a struct or iterate the elements?
(I see printing a struct serializes it nicely, but there doesn't seem to be a way to convert it to a string)[Edited to included answers for questions ]
-
-
I can answer a few very quickly...
Any way to run code from another script/program without having to copy and paste into each file?
No, I'm afraid not at this point
A way to check if the analog sticks are pressed like buttons?
Yes - read the controls into a var (c for example) and then test for c.lc or c.rc
Any way to get the script to/from the switch without manually copying?
As per 5 - not at this point in time. This is a restriction we have to work with from Nintendo at this time.
-
Thanks for the quick reply!
Makes sense that they'd have that restriction now that you mention it.
Edited the Joycon test program to include lc and rc, this works, thanks again!