Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Going to the main module
#1
I have seen the code for this somewhere, but I cannot remember where.

When I am in a sub, and I would like to go to the main module, what code would I use?

Thanks.
Reply
#2
Look up EXIT SUB in the help file.
size=9]"To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." -- Theodore Roosevelt[/size]
Reply
#3
I tried EXIT SUB, but that did not take me back to the main module. It just ends the program.
Reply
#4
EXIT SUB and END SUB return program execution to the routine that called the subroutine. If that routine is MAIN, then that's how you get back to MAIN. Otherwise, you have to exit all levels of subroutines/functions before getting back to MAIN. In the program that EXIT SUB caused to terminate, was there anything in the program after the call to the subroutine?
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#5
Quote:In the program that EXIT SUB caused to terminate, was there anything in the program after the call to the subroutine?

No, I don't believe so.
Reply
#6
Then that would be why exiting the sub just ended the program. :wink: Try putting just some random code after the call and it should perform it before ending the program when you exit the sub.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)