Ok guys, sit back, take a breath, give me a little while to come up with a better answer.
All will be revealed. Or further confused. We'll see.
Ok guys, sit back, take a breath, give me a little while to come up with a better answer.
All will be revealed. Or further confused. We'll see.
DT
I'll try something...
Nothing hard here right? after the Return... you return to Label1 ... right?Code:StartPoint: Gosub Somewhere Label1: Pause 100 Goto Start Somewhere: Pause 1 Return
Now...
Same thing happen here...Code:StartPoint: Gosub Somewhere Label1: Pause 100 Goto Start Somewhere: Goto SomewhereElse z: goto z SomewhereElse: Return
This said...
Where the Return of Routine0 leads you?... to ReturnPointCode:Start: for routines=0 to 3 StartPoint: gosub subselect ReturnPoint: pause 200 next goto start SubSelect: branchl routines, [Routine0, Routine1, Routine2, Routine3] Routine0: return
I know i'm a pretty bad teacher...![]()
Last edited by mister_e; - 18th November 2006 at 20:02.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
and I am a good student.
I thought that once the program jumps, then it will forget where it was and will return to an unknown place. So that it will never be 100% precise.
---------------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Gosub and Return are good friends...
As long as you have a GOSUB... you can insert 2789423564875634275624365 432956345634564326586324957243657 234596243652 43656243756243654 356437856 46582436587243657 26435726435 2436 (+/- 1) goto in-between. And when you'll use Return, it will return just under the GOSUB.
Last edited by mister_e; - 18th November 2006 at 20:11.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
To be even more specific, the GOSUB will put a return address on the top of the "Stack" It will remain there forever (as long as the PIC is not reset) until a RETURN is executed. So, Steve's 2.7894235e+128 GOTOs do nothing to modify the address on the top of the stack. And, no matter when the RETURN is executed, the program will return to that address.Originally Posted by sayzer
HTH,
Steve B
Last edited by SteveB; - 18th November 2006 at 20:17.
SteveB....SteveB....SteveB....
SteveB....SteveB....SteveB....
Whizzz... Woohoo...
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1198&stc=1&d=116388100 4">
Last edited by mister_e; - 18th November 2006 at 20:25.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
AhhhhhhhOriginally Posted by Darrel Taylor
, I was really looking forward to it. My stab at it was just a down and dirty continuation of what Steve was getting at. We'll let Sayzer and Ryan weigh in on whether it worked for them.
I have a new teacher now!
Thanks for this simple and clear explanation SteveB.
I was expecting DT to come up with really complex explanations. heheh
--------------------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Bookmarks