Post
by PepsiHog » Sun Sep 18, 2016 9:04 pm
Hi,
Jumping in and out of srt's is a pain. Problem is you can't stop GoSub from returning. Plus there are situations where depending on the srt you gosub to, you may want that srt to jump to yet another. But this causes what I call "the rubberband effect" It springs back to the original srt, and by then things may have changed to the point where it causes an error in the original srt. Or you get that annoying message about jumping out of a srt. Which for the most part I agree and understand the message. But there still are some cases where you wish it would stop warning you.
I have made my own solution to this problem. It is no longer a problem for me. Don't use gosubs in your srt's. LOL! You think I'm NUTS! And I am. Here is how....
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Begin Program
let>MySrt=FirstSRT
let>neverending=0
While>neverending=0
gosub>%MySrt%
endwhile
srt>FirstSRT
blah, blah, blah
does what you need.
if>result=blah
let>MySrt=NextSRT
else
let MySrt=FirstSRT
endif
End>FirstSRT
rest of program.....
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
So all you do is conditionally set the srt you want to call. The current srt will end on it's own and the program will jump back to the neverending loop and gosub to the next srt. Which is whatever srt you assigned to MySrt.
So in other words, don't use gosub in your srt's. This works great when you are writing a macro piece by piece and need to avoid pain-in-the-butt-messages. Later once you figure everything out, you can remove MySrt and make appropriate gosubs according to what you need. Or not.
Ofcourse, you still have to plan out the srt's. When your srt gets called, keep in mind, it will start from the top. There may be times when you want to use gosub if you know the called srt won't be calling any others, or you need it to return.
PepsiHog
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!