use Break or continue within functions
Thanks for you reply, Brendan
This is the type of structure I would like to achieve, although this example would give an infinate loop it demostrates the theory.
alert("THIS ALERT WILL NEVER SHOW")
1 person found this helpful
Functions are your friends. You do not want to be avoiding them.
I have used them in quite a few scripts that I have created but I do find that if you try to add them to an already created script it can cause quite a few variable problems (well for me it does ), my understanding of them isn't fantastic yet so thought a simple goto line might exist... beginning to think the spectrum had it right 35 years ago
Will keep working through to see what can be done.
I recommend reading up on functions because they WILL simplify things.
Variables are pretty straight-forward. Just declare all your variables using var inside your functions and pass in any others as parameters or attach them to global objects.
For the record:
In short: you can switch to Visual Basic to have GOTO routine, but...
Mixing functions with various loops (for, while, switch) should essentially improve your code.
If you cant see the way of using them - means that things are far too much complicated already.
We have moved on from the zx80, zx81, spectrum days.
Clive Sinclair (Spectrum) went bust quite some time ago.
If you want to join him follow the practices of those day if not take Harbs advice
Well, thanks for the advice Trevor. Will try not to add the background of my logic into my questions again.
A big thank you to everyone else, you've been very helpful and I have been looking at the function way for the past couple of hours to see what I can get working.