This is more a note to other users and to myself as a reminder.
I had need to compile a program written about five years ago. This program was previously working without any noticeable issues. Today on compilation I got the error reported:
Which pointed to this sub, specifically the 'End Sub' line:
SubShowNameMessageCheck_SwitchesIfSwitchValue=SwUPThenGet_The_ValuesPrint"Bon: Gsw: "'Show the valuesLocate0,4Print(Acc_T_Value)Locate0,12Print(GSWin)ReturnEndIf' 0123456789012345Print" Super Lottery "'Show the splash screenEndSub
Scratched my head for a while decoding this error and then decided to comment out the 'End Sub' line.
The error then pointed to:
Return
I changed this to
ExitSub
Then reinstated the 'End Sub'.
This sub then compiled, but I had used 'Return' in another sub in the same way, preventing compilation at that point too.
Changing the 'Return' there as well allowed the program to compile.
I guess that at some point the compiler has been changed to not allow 'Return' to exit from a Subroutine, only to return from a GoSub.
Confused me for a while though...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is more a note to other users and to myself as a reminder.
I had need to compile a program written about five years ago. This program was previously working without any noticeable issues. Today on compilation I got the error reported:
Which pointed to this sub, specifically the 'End Sub' line:
Scratched my head for a while decoding this error and then decided to comment out the 'End Sub' line.
The error then pointed to:
I changed this to
Then reinstated the 'End Sub'.
This sub then compiled, but I had used 'Return' in another sub in the same way, preventing compilation at that point too.
Changing the 'Return' there as well allowed the program to compile.
I guess that at some point the compiler has been changed to not allow 'Return' to exit from a Subroutine, only to return from a GoSub.
Confused me for a while though...
Your observations are correct.
I tightened up the syntax EXIT SUB is now, correctly, associated with SUB.
This change permits the syntax checking part of the compiler to ensure the source program are correctly structured.