-
Thanks for your kind words, @Robin.
'I realize my newbie question is quite senseless'
I wanted to express, that I feel a bit guilty asking questions which could've been answered by myself by a revision of my code and re-reading some tutorial-parts. But maybe you're right, sometimes you need a kind of other "input" to get to a solution.
Are you sure you are a beginner??
Before starting this project I copypasted tutorial-codesnippets into the IDE or tried changing code-parts of e.g. a clock app to change its look. So I guess so.
You indiated in post #3 two references, (the API Reference helped a ton and mozillas MDN JavaScript reference was very helpful too) are there by chance any others that you are using that helped here?
I tried several Youtube-tutorials, but never found one which focuses on javascript without combining it with html and css. So the great tutorials on espruino.com and those mentioned references were the only "sources of knowledge" for me.
Carefully review L36 in post #7 and review examples at MDN:
Ah, it's obviously unnecessary, as there are only two conditions for tstate :D . Should've rechecked before posting.
Thanks again for spending your time on my gain of knowledge! Really appreciate that!
-
Thr 2021.05.20
'So the great tutorials on espruino.com'
I believe that Gordon is the main creator of that content and deserves the credit.
'I tried several Youtube-tutorials'
Myself, I prefer the text snippet layout that currently exists and it's actually what drew my attention to Espruino in the first place.
Do you feel then, that having more video tutorials would be a better alternative?
'I wanted to express, that I feel a bit guilty asking questions which could've been answered by myself by a revision of my code'
Hey @radswid go easy on yourself!! I'm impressed recognizing the 'intuition' you are using to solve these miniscule anomalies yourself, and completed in two days!! No one gave you the answers. All I did was point the compass in the correct direction to allow you to turn over those stones that were hiding the treasure. (or as allObjects might relate to, trim the sail to better tack into the wind ;-)
Regarding: 'Are you sure you are a beginner?? . . . . So I guess so.'As I recognized your skills in a near complete solution with minimal upfront knowledge, My reason for asking was that should you be younger and seeking a career, that as you possess the fundamental skills that those that continue on also expand on, seriously consider software development. You were able to read into suggestions, the 'Think-Do-Think' mindset, then translate that to your project using 'Do-Think-Do'. . . . and, . . . Viola`! your working code block. Impressive skill set indeed!!
Really nit-picky here, and I'm not the one to qualify even this assessment, 'let vs. var'
My understanding is that 'let' was intended for block scope within functions.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var
https://stackoverflow.com/questions/37916940/why-was-the-name-let-chosen-for-block-scoped-variable-declarations-in-javascriWhile either will work in your code block as global scope rules apply, there may be a reason for one over the other. Maybe the need for another thread here, or analysis by @allObjects, @AkosLukacs, etal
Request for @Gordon completion here:
As I have not studied up on Bangle Apps and deployment, I'm not sure if the following should be done, or even if it is possible.
Q1: Should the App itself contain startup logic as described in the following, is it wise to do so?
launching page - sample snippets
Great read written by allObjects
simple explanation how to save code that espruino run on start?
Q2: Is is possible to turn the App itself into a module, pros and cons doing so?
Wed 2021.05.19
On the contrary, . . . it was necessary to learn the if-else construct prior to being able to realize that the second twist event would not be required. In your mind before that eureka moment, there wasn't a means to get to that realization, so at that point, creating this post was one of the only means to get to the solution you found. Quite logical when one views this thread thinking the events in reverse.
Using Gordon's #6 post which is a refinement of the hint I provided in #4 post, allowed you to resolve in a very short period of time the solution I (we) intended you to get to. So, @radswid in around a 24hr period, you were able to comprehend what we were communicating, even though was in more of a hint format, rationalize how that needed to fit into what sequential event sequence wasn't occurring, use intuition and maybe a bit of language syntax learning lookup, in order to present a better structured and simpler coding result, code and debug that solution and all in one evening to-boot!! Are you sure you are a beginner?? ;-)
Now, please help me here. I'd like to create some tutorials (not related to this project) and have my own references. You indiated in post #3 two references, (the API Reference helped a ton and mozillas MDN JavaScript reference was very helpful too) are there by chance any others that you are using that helped here?
Now that the final solution is near, there are a couple of observations I'd like to make. Please don't take this as criticism, as it usually takes quite a bit of time before patterns and coding techniques are mastered. And since this solution was found overnight, that hardly fits into
the 'quite a bit of time' duration.
Carefully review L36 in post #7 and review examples at MDN:
The hint here is to simplify. See how that task now may be an improvement.
I have several others, that we may tackle one-at-a-time.