Hello TempodiBasic and Steve
TempodiBasic, to answer your questions, I wasn't sure how to use the "code box" and the example of the problem were 2 short coding programs, and to your second question I REM'd them because neither one of those worked for me. I did try the Dim Shared in program 1 and program 2. And I agree with you, I am using $Include as a quasi sub routine.
I also agree with Steve, $Include is a means of inserting a block of set text. In this case I'm inserting the same block multiple times. What I was trying to do was to find a way to Exit the $Included block of text early. The only thing that came to mind was a Common variable that would trigger the Included block to end earlier rather than running the code to its end. I did expect, when the main and Included block of coding ran, that there was an automatic sharing of variables and I could avoid the issue of passing values as happens with Subs.
In my example programs, although both the main and the included have the same COUNT variable, the IF statement triggering the premature end of the Included file doesn't work. Or at least hasn't been working for me. I gather then that the coding in an $INCLUDE must run it's course unlike a Sub/Function which you can Exit early.