Hi All,

Answering your question (rosfree) about the clearing nested subroutines, the answer is no. The subroutines can't be cleared what you have to do is set a lot of flags or just review all your algorithm to fit your needs.

Some time ago I had a problem with nested gosubs and had to use goto's mixed with gosub's it was a pain to figure out how to do that and I had to rewrite all the program. So my sugestion is: Stop and check all your needs before start writing your code. Check the manual for compiler limitations. It will save you a lot of time.


Main:
do this
do that
gosub here
goto main
end

Here:
if do_dat_squat then goto there
do this
do that
return

There:
do this
do that
goto main

What you can do is setting a flag and testing it so instead of using the "goto main" you just use the "return".

Main:
do this
do that
gosub here
goto main
end

Here:
if do_dat_squat then
flag=1
goto there
endif
do this
do that
return

There:
do this
do that
if flag=1
flag=0
return
endif
goto main


I'm not sure what are your needs but this is not a real good programming technique and it can spend a lot of space in programs memory (it will depend on how the compiler translate it).

Will you call the "There" routine in other parts of the program? if not and if you didn't use all the stack with nested gosubs, the best way is to call the routine or just follow Mister_e example that saves you a lot of trouble.


Hope this help.

Hans