Up the top of your file? You can then just log in and type FILENAME and it'll tell you. I know you have to keep updating it when you save to a new filename, but it's not too bad.
I want to avoid taking up memory using things that 1 person in 100 will use - there's just so little available :(
I guess one good way of handling this would be to add preprocessor-style predefined variables - for instance __FILE__ and __TIME__ - then it's just a matter of adding FILENAME=__FILE__; to the top of your file. Time especially would be pretty cool, as it'd let you automatically set up the internal RTC every time you uploaded code.
Only thing you have to watch out for is because the Web IDE is a Web App, it doesn't have access to your filesystem - so I don't believe it knows the full path of the file, only the filename itself.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Could you not just write:
Up the top of your file? You can then just log in and type
FILENAME
and it'll tell you. I know you have to keep updating it when you save to a new filename, but it's not too bad.I want to avoid taking up memory using things that 1 person in 100 will use - there's just so little available :(
I guess one good way of handling this would be to add preprocessor-style predefined variables - for instance
__FILE__
and__TIME__
- then it's just a matter of addingFILENAME=__FILE__;
to the top of your file. Time especially would be pretty cool, as it'd let you automatically set up the internal RTC every time you uploaded code.Only thing you have to watch out for is because the Web IDE is a Web App, it doesn't have access to your filesystem - so I don't believe it knows the full path of the file, only the filename itself.