Question about Stop, Sleep, and End. Yes, I checked the help guides.
flylikechris
Posts: 3
Hi guys, my teacher asked me two questions that have been giving me problems.
1) Which command can not be used inside of a DO...LOOP structure?"
s) FOR...NEXT b) STOP c) SLEEP d) END e) None of the Above
2) The STOP command can be used inside of a DO...LOOP structure. True of False?
The problem is that technically I can put any of these commands in the DO..LOOP.
Even if not logical..
Especially considering END and STOP perform almost the exact same function (with the exception of power save mode).
Any ideas?
thanks!
1) Which command can not be used inside of a DO...LOOP structure?"
s) FOR...NEXT b) STOP c) SLEEP d) END e) None of the Above
2) The STOP command can be used inside of a DO...LOOP structure. True of False?
The problem is that technically I can put any of these commands in the DO..LOOP.
Even if not logical..
Especially considering END and STOP perform almost the exact same function (with the exception of power save mode).
Any ideas?
thanks!
Comments
someLabel:
'... inside the DO...LOOP
GOTO someLabel
You can have any statement inside the DO...LOOP as long as things like other DO...LOOP, IF...ENDIF, and FOR...NEXT statements fit completely inside. For example, you can't have DO...FOR...LOOP...NEXT. Whether what you've written makes sense and whether what you write executes the way you want is something else entirely. We can't give you the answers to your homework, but think about what you know, think about the various statements, and reread the descriptions in the Basic Stamp Manual.
The micro-controllers for the BS have an assembly instruction called SKIP, an unconditional skip of the next line of code. But why would one write a line of code and then skip it? There may be a reason, but I find it hard to see one.
In other words, there are technical possibilities in writing programs that are somewhat absurd. Just like oxymorons in language. Have you ever met an 'honest liar'?
BTW, the real answer is to test each and see which actually work.
Now hold the phone there for a couple of minutes, in my 65 years I have not stole or killed anyone. I have been fateful to my wife and have not cheated anyone. My word is my oath and if I say I will do something I really mean it. (Except for maybe one more beer to my wife) I actually slow down on the back roads for ducks and cats while I am driving. The only problem is I like to go fishing which makes most people think I lie. Whoa there, they are right!